Sens. Patrick J. Leahy (D-Vt.) and Charles McC. Mathias Jr. (R-Md.) agreed yesterday to recommend that the Senate reject the ban on publicly funded abortions that was put into the District of Columbia budget earlier this week by the House of Representatives.

Leahy, chairman of the Senate D.C. appropriations subcommittee, and Mathias, its ranking minority member, also agreed on the proposed Senate version of the city budget for the 1980 fiscal year. But they ordered that its amount be kept secret until Monday so accompanying documents can be prepared.

The House had voted an operating budget of nearly $1.4 billion, which would be$65 million more than the 1979 budget but $78 million less than the city requested. The budget would be supported partly by a federal payment of $191.5 million.

An aide said both the budget and the federal payment to be recommended by the two senators are larger than the House amounts, partly because the Senate is considering $52 million extra requests that were made by the city too late for the House to act.

On the abortion question, the aide said Leahy and Mathias agreed that Congress should not dictate whether the District should be permitted to use its own local tax revenues to pay for the procedure for poor women. Under previous congressional action, the District -- like all the states -- is prohibited from using federal Medicaid money for abortions.

If the Senate upholds the two senators, the question will have to be resolved by a joint Senate-House conference committee.

The House bill contains two provisions dealing with the abortion issue. One provisions says the District could spend its funds for "medical expenses necessary to saving the life of a pregnant woman," but does not spell out what procedures would be permitted or prohibited. The next provision declares in full: "None of the funds appropriated under this (budget) act shall be used to pay for abortions."

On Thursday, the Senate voted -- in separate national legislation to continue for another year the existing legal restriction on Medicaid-financed abortions. Under the provision, federal funds could be used for abortion only where a mother's life is in danger, where a pregnancy is the result of rape or incest or where birth may create medically certified danger to a mother's health.

The House version of the same national bill would restrict abortions to instances where a motherz's life is in danger