The city is challenging the federal government’s authority to send troops into the city for what the president has called a “public safety emergency.”