Embattled Mayor George R. Moscone has won a new political lease on life after an election that was in many ways a throwback to old-style "mud-slinging" campaigns.

By a margin of nearly 2-1 voters in this distinctive city rejected a ballot proposition that would have forced Moscone, Sheriff Richard C. Hongisto and District Attorney Joseph Freitas to run for re-election in December, during the middle of their terms.

At stake was the political style and direction of a city that has long prided itself on being a tolerant haven for persons of different views, classes, races and lifestyles.

The campaign for Proposition B. which would have forced the mid-term election, was led by Supervisor John J. Barbagelata, who considered himself a spokesman for what he and some of his supporters called "Old San Francisco."

Barbagelata deplored the city's high crime rate, which he blamed on the permissiveness of Moscone and his appointed out-side police chief, Charles Gain. He depicted Hongisto as a "dangerous man" who treated ajil prisoners too leniently and who appeared on platforms with sich speakers as radical activist Tom Hayden.

Throughout the campaign Barbagelata was under police guard as the result of bombing and shotting attempts and an anaonymous campaign leaflet that described him as "a deranged buzzard".

Moscone an avowed liberal and close ally of the city's two congressmen, Phillip and John Burton, has appointed many minority members to city boards and commissions had has a tolerant attitude toward the homosexual community.

The question of gay rights became a special issue in the campaign when Hongi-to flew to Miami to campaign for an ordinance that would have barred discrimination against homosexuals in employment and housing. The homosexual community, estimated by Hongisto at 15 per cent of the city's voters, worked hard to defeat Proposition B. On Tuesday, the "alternative life-style" areas of Haight-Ashbury and Noe Valley cast heavy votes against the ballot measure.

Moscone also had the support of the Chamber of Commerce, which feared that a mid-term recall election would give the city a banana republic image and damage long-term business commitments to redevelopment projects that have been pushed by the Moscone administration.

On Tuesday this broad range of support paid off for the mayor, as he won 10 of the 11 supervisorial districts, losing only Barbegelata's home district. The vote was 64.3 per cent against Proposition B and 35.7 in favor. By a 57.5 per cent to 42.5 per cent margin, voters rejected another measure, Proposition A. which would have eliminated the supervisorial districts and had all supervisors chosen at.

But Moscone's campaign gave as good as it got under the direction of veteran campaign manager Don Bradley, who once directed statewide campaigns for former Gov. Edmund G. (Pat) Brown.

Bradley's television and radio ads depicted the Proposition B. forced as a "greedy band of power grabbers" who were out to fleece the city.

The defeat of Proposition A was a victory for minority groups and organized labor, which supported district elections. It was a defeat for the business community and a majority of board of supervisors, who favored city wide elections.

"What really pleases me is that it shows this city is not polarized between the haves and the have-nots, between the straights and the not-so-straights," Moscone said yesterday. "It means that we're going to be able to move forward toward without the obstruction of the last two years."

Moscone was elected mayor by a narrow margin over Barbagelata in 1975, at a time when the New York City financial crisis dominated the headlines. Barbagelata's strong showing at that election, said Moscone, made other supervisors think his constituency was larger than it actually was.

Barbagelata, whose term expires in January, 1978, said after Tuesday's election, he would not run again.

A last-minute mailer by the Police Officers Association, which dislikes chief Gain, accused Moscone of being responsible for the city's high crime rate.