When District of Columbia tax collections surge above expectations, as they did earlier this year, who should benefit - city taxpayers or the U.S. Treasury?

The taxpayers and the treasury have a $20 million stake in the answer to that question, but they will have to wait at least a couple of months longer for the answer.

The answer will come when Congress finally gets around to approving the D.C. budget for fiscal year 1977, which began Oct. 1, and decides the level of the federal payment to the city.

The House has approved a payment of $295.4 million. The Senate, noting the increase in local tax collections, voted $276 million. That is where the issue stood when a Senate-House conference committee broke off deliberations last month after becoming dead-locked on other budget issues.

The House voted this week to permit the city to continue spending until next Sept. 30 at the level of the last fiscal year, with the same federal payment. Senate concurrence was needed to make this become law.

Despite a large measure of home rule, the District of Columbia is treated for budgetary purposes much like a federal agency - with one major difference.

Unlike federal agencies, the city must propose to Congress a budget that is balanced.

In theory, the federal payment is a sum designed to compensate the city for taxes it cannot collect on government-owned property and for municipal services provided to government installations. Under current law, the maximum federal payment is $300 million.

In practice, the payment is an arbitrary figure provided by Congress to make up the gap between the expected income and the authorized outgo. In recent decades, it has soared from $20 million in 1958 to $276 million last year.

Earlier this year, city tax collections began rising well beyond estimates made earlier by the D.C. Department of Finance and Revenue.

Sales taxes spurted when the city's lagging construction industry came to life. Taxes on parking garage charges and restaurant meals climbed, in part because of higher prices. Personal and corporate income taxes also rose, and a major estate was settled, bringing with it a $10 million windfall in inheritance taxes.

For the first times since 1972, the city collected in the 1976 fiscal year more money than it paid out - about $15 million more, according to the D.C. Municipal Research Bureau, Inc., a privately financed research organization.

The House District Appropriations Subcommittee, headed by veteran Rep. William H. Natcher (D-Ky.), recommended the proposed 1978 payment of $295.4 million before the upward trend was known.

However, the Senate District Appropriations Subcommittee, headed for the first time this year by Sen. Patrick J. Leahy (D-Vt.), a self-described fiscal conservative, recommended $276 million.

The Municipal Research Bureau reported that the rising tax yield "provides a greater base from which to project revenues for (future) years, and it permits more optimistic assumptions about economic growth rates in the city."

But on the bad side, the bureau had this warning: "If Congress treats the federal payment as only a device to balance the city's budget, and therefore adjusts the payment downward to reflect improved city revenue collections, then there will be little net financial gain for the city in its 1978 and 1979 budgets.

"The Senate is currently proposing such a policy . . .Penalizing the District for improved revenues will reduce the incentive for the city to encourage economic growth, and to improve collection of taxes."