The District of Columbia spent nearly $2.6 million of its own funds to control the protesting farmers who spent a month encamped on the Mall and holding tractorcades on city streets, Mayor Marion Barry told a Senate hearing yesterday.

Sen. Patrick J. Leahy (D-Vt.), who conducted the hearing, promised to help persuade the federal government to reimburse the city for its expenses.

Most of the money, $2.1 million, went to pay police overtime wages, Barry said, with another $333,100 spent mainly as rent on Metro buses used to help form the ring of vehicles that penned the farmers and their tractors on the Mall.

Several other city departments also ran up costs from the American Agriculture Movement demonstration, Barry said. The Department of Transportation spent $47,400, including $27,900 in overtime costs, for traffic control. The Department of Environmental Services spent $30,600, half of it for payroll costs, to provide waste, water and engineering services for the protesting farmers.

These were additional costs, over and above what the city would have spent if the demonstration had not occurred, Barry said. It did not include the costs to city workers and motorists who were delayed by tractorcadecaused traffic jams, he added.

Leahy, who is chairman of the Senate D.C. appropriations subcommittee and a member of the Senate Agriculture Committee, said he agreed with Barry that the city ought to be able to bill the U.S. government for out-of-pocket costs of such demonstrations.

There is no standard procedure now, although the city's home rule charter permits reimbursements. The last time this procedure was used was to pay the city's expenses of President Carter's inaugural in 1977.

Leahy also heard testimony from Manus J. (Jack) Fish, director of National Capital Parks, the federally funded arm of the National Park Service, which has jurisdiction over the Mall.

Fish said the latest estimate of damage to the Mall, made by a superintendent of his staff, was $745,000, well below earlier estimates that ranged from $1 million to $2 million. Fish said yesterday that he expects the total to drop even more, to "a little under $500,000."

To the projected $500,000 in damage must be added another $500,000 in overtime costs paid to U.S. Park Police personnel, putting the total cost to his agency at about $1 million, Fish said.

Leahy said the demonstration harmed the farmers' image, a statement challenged by Ailiff (Butch) Neel, a farmer from Windom, Kan., who testified that the added costs stemmed chiefly from the police decision to keep the farmers on the Mall.