California legislative leaders yesterday agreed to rescue the state's local governments from the threatened doomsday effects of Proposition 13 by voting to give them more than $5 billion in state surplus funds.

The agreement, taken by a conference committee and considered certain to be approved by the full legislature, replaces all but $2 billion of the revenue lost to cities, counties and school districts under the Jarvis-Gann property tax cut initiative approved overwhelmingly by voters earlier this month.

For most local governments, the legislative agreement means they will have at least 90 per cent fo their present revenues in the coming fiscal year. Some cities, notably San Francisco and Los Angeles, will do even better because they have raised or imposed various charges to make up for lost revenue. Thus, while taxes will bu cut a great deal, service will be cut relatively little - this year.

But Democratic leaders warned that the state merely had postponed its crisis to future years when surpluses are expected to be insufficient to bail out local government.

Assembly Speaker Leo McCarthy of San Francisco predicted "a severe crisis" next year. State Sen. Albert Rodda of Sacremento, chairman of the two-house legislative committee which engineered the rescue package, said the fiscal crunch would come in three years after repeated local cutbacks.

Whatever the future may hold, the actual job impact of Proposition 13 so far has been slight. The states's economic development department reported yesterday that actual layoffs by all public bodies in California since the passage of Proposition 13 totaled only 2,148. One aerospace company alone, Hughes Aircraft, has announced plans for hiring 3,500 new workers during the coming year, and many business spokesman have said they will expand investment because of the tax savings given them by Jarvis-Gann.

The state report appeared to support the complains of Proposition 13 supporters that local governments had panicked and scared people needlessly with summer school closing and budgets calling for wholesale layoffs. One extreme case was provided by the Los Angeles School District, where summer classes were canceled even for the 500 students who needed them for graduation.

In San Francisco, where Mayor George Moscone had proclaimed a state of emergency, an increase in local payroll, parking, business and property transfer taxes plus the city's share of the state surplus will mean a budget decrease of just 5 percent.

While Proposition 13 was ardently supported by political conservatives and opposed by many liberals, the legislative rescue package actually accomplished some long-term liberal objectives.

The most important of these was a state takeover of $1 billion in welfare, food stamp and medical care programs now administered by counties. Recognizing that county supervisors usually have been far more critical of welfare programs than the legislature, welfare recipient organizations have long pushed for a state takeover. Their attempts at doing this had until now consistently been blocked by conservative legislators.

Another long-sought change approved yesterday made the state's 58 counties responsible for 4,700 special districts which supply water, lighting, firefighting, insect control, soil conservation and various other services.

The legislature accomplished this by giving the counties $125 million for the special districts and telling them to allocate it, a process likely to mean some district consolidations that most government analysts consider long overdue.

These were the other elements of the legislative agreement, which provided $5.022 billion in assistance for local government:

School districts, which had obtained half their revenues from property taxes, will get the largest share of state aid, $2.7 billion. This brings the districts to 90 percent of funding, but most districts will have more than that because of the summer school closings.

Counties, which raised 28 percent of their income from property taxes, will get $450 million as well as the $1.1 billion savings from the welfare takeover.

Cities, which depend on property taxes for only 15 percent of their revenue, get only $250 million. But they are able to raise charges and levy some taxes of their own.

A $900 million emergency loan fund will be established to save local governments from any cash flow problems.

In returning the surplus to local government, the legislature required all public agencies to freeze salaries for the 1978-79 fiscal year and also mandated that police and fire service not be reduced.

These two provisions, taken together, could cause a problem in labor negotiations now occurring in some cities. Don Benninghoven, executive director of the League of California Cities, said that this would encourage unions to bargain for greater retirement benefits, which already consumed a disproportionate share of municai budgets.

There was widespread agreement in the legislature that the agreement would make Proposition 13 work but that the task of solving some of the complex issues raised by Jarvis-Gann had just begun. Even before the legislature voted, staff aides were preparing a "trailer bill" intended to clean up errors which may have been made in distributing $5 billion under formulae that were prepared in a few hours.

"Having rescued the state from chaos," said Rodda, "the legislature can now proceed to address the problem of total confusion."