This is one of those things where the courts give deference to the administration. It is an emergency action. You can litigate it later, but due to the claim of imminent harm the courts will not block the government's action.
Think about when Trump activated the National Guard and ordered them into action in California. The courts ruled against him after the fact, but the courts refused to block the action because the governments claim was imminent harm could occur.
The court MUST give deference to the government in emergencies. Just as you MUST give way for an ambulance with lights and siren going -they get the benefit of the doubt, even if it later turns out they were just sick of sitting in traffic.