President Donald J. Trump announced late Monday that he and congressional leaders had reached a deal on a two-year budget and the debt ceiling.