Lawsuit over state’s treatment of foster children with mental illness will proceed