The unions argued that Trump’s plan to reduce the agency’s workforce violated the US Constitution and federal laws.