State’s move to bump federal judge from longtime foster care lawsuit caps years of battles