A judge on Tuesday barred the federal government from making arrests at immigration courts, ordering an end to a practice that took hold shortly after President Donald Trump took office last year.