A federal judge has prohibited U.S. immigration authorities from relying on databases deemed faulty to ask law enforcement agencies to hold people in custody, a setback for the Trump administration that threatens to hamper how it carries out arrests.