Three teenage boys convicted of rape should have been detained, the Court of Appeal hears.