Senate Democratic leaders announced yesterday they have reached an agreement on how to end their impasse over the fiscal 1980 budget resolution, paving the way for floor action on the controversial measure next Monday.

The compromise would retain virtually intact a Budget Committee order requiring various Senate committees to trim $4 billion from previously enacted spending bills, but would give them more time to do it.

If it holds together, the agreement would represent major concessions by the Appropriations and Finance committees, whose chairmen earlier had opposed the rollback order and had vowed to fight it on the floor.

However, sources said Finance Committee Chairman Russell B. Long (D-La.) who was out of town during the closed-door negotiations, still has not been briefed on the plan, and may decide ultimately not to go along with it.

The fight over the rollback order had threatened to jeopardize approval of the budget resolution. Long had been allied with Appropriations Committee Chairman Warren G. Magnuson (D-Wash.), who also opposed the move.

The controversy arose after the Budget Committee proposed the $4 billion in cutbacks to make up for promised cost-saving legislation that the lawmakers never enacted. Without these cuts, the deficit would rise by $4 billion to $32 billion or higher.

Both Magnuson and Long had complained that the cuts were too substantial to be accomplished this late in the session, and that they could not possibly push through the changes in the 10 days the Budget panel had sought.

What the Democratic leaders did yesterday was to break up the Magnuson-Long alliance by extending the deadline for the cutbacks to 30 days and allowing Magnuson to complete all his appropriations bills before deciding what to cut.

They also trimmed by $300 million the $1.4 billion worth of cutbacks that the Finance Committee would be ordered to make, primarily in the Social Security program. And they pared the proposed cut in veterans' benefits by $100 million.

Although the agreement was negotiated entirely by Democrats, sources said the compromise probably will be billed on the floor as a bipartisan proposal. Republican leaders were kept advised of the talks.

The budget resolution would set binding spending ceilings for Congress, aiming at a deficit of $28 billion. In a tentative budget measure passed last spring, the two houses provided for a deficit of $23 billion.