RALEIGH — Teenagers in North Carolina’s juvenile justice system are routinely being locked alone in their rooms for as much as 23 to 24 hours a day, according to an ongoing federal lawsuit and advocates for young people in custody, despite state officials’ own acknowledgment of research showing that prolonged isolation causes mental and physical harm.