US judge rules migrant families can't be held long-term