The Trump administration defended what it says is a lawful executive order looking to reorganize agencies and terminate workers, telling a California federal judge that unions, nonprofits and local governments “waited far too long” to seek a temporary restraining order.