The Trump administration’s practice of detaining migrants at federal courthouses had stirred outrage.