The legal dispute stems from an executive directive by President Donald Trump that halted a wide range of federal expenditures.