The nation's railroads have tentatively reached a contract with the last of the big rail unions, apparently averting a nationwide strike that had been threatened for early spring.

Fred J. Kroll, president of the Brotherhood of Railway and Airline Clerks (BRAC), said the proposed settlement provides a wage and cost-of-living increase of 36 percent over the 39-month life of the contract.

This exceeds President Carter's anti-inflation guideline of 7 percent for annual wage and benefit increases. But the guideline was announced after other rail unions negotiated a pattern settlement for the industry, thus exempting the BRAC pact so long as it conformed to the pattern.

"I would not expect it [the guideline] to be any problem," said Charles Hopkins, chairman of the National Railway Labor Conference, the industry's bargaining group.

The proposed settlement, reached late Saturday must still be ratified by BRAC members. Kroll said yesterday he expects an "overwhelming endorsement" in rank-and-file voting scheduled for later this month. The proposal will be submitted to BRAC's full bargaining committee Tuesday, to the union's general chairmen on Wednesday, and to the members by mail on Thursday.

Only if an absolute majority of the union's roughly 100,000 members covered by the contract reject the pact will it fail to be ratified. Previous contracts required only the approval of the union's exectutive board.

Twelve of the 13 rail unions have now given at least tentative approval to a new contract, leaving only the 2,500-member American Train Dispatchers Association to reach an agreement.

"The dispatchers are currently in mediation... and when that situation is resolved, the country can look forward to labor peace in the railroads for the next three years," said a spokesman for the National Mediation Board, which handles railway labor disputes.

BRAC, which crippled most of the nation's rail service during a four-day strike last fall in a separate dispute with the Norfolk & Western Railway, had authorized a nationwide walkout for mid-March if a constract was not reached by then.

Under complicated machinery of the National Railway Labor Act, the contract dispute would have gone to the president on Thursday. After another 60 days, the union would have been free to strike, barring congressional intervention.

In announcing what he called a "landmark" settle ment, BRAC's Kroll said it included wage increases computed on a cents-per-hour rather than percent age basis, which means more money because clerks start from a lower wage base than most other railroad workers. Cost-of-living increases are to be provided at fixed levels, rather than on a sliding scale pegged to fluctuations in the inflation rate.

He said the settlement also included back pay averaging about $1,000 per worker, including a $100 bonus for the first three months of 1978, along with "significant" health and welfare benefit improvements, more days off and a payroll checkoff for voluntary political contributions.

The industry also agreed to drop its insistence on a moratorium on work rules changes, Kroll said.

The contract runs until March 31, 1981, replacing an earlier contract that expired Dec. 31, 1977.

The other unions' contracts have been estimated to include pay increases of roughly 35 percent, depending on the exact cost-of-living during the life of the agreement.