Socialist Mayor Bernard Sanders won reelection yesterday in a three-way race in Burlington, Vt., after an all-out campaign to prove that his 1981 victory was not a fluke.

"The victory was more than we thought," he said last night. "It's one thing to win an election. It's another thing to run for reelection based on your record."

City officials placed the turnout at about 13,000, a record for a mayoral election in Burlington. Two years ago, 9,400 votes were cast.

With all precincts reporting, Sanders had 52 percent of the vote, Democrat Judy Stephany 30 percent and Republican James Gilson 17 percent.

Sanders, who ran as an independent, rolled up commanding leads in the low-income and student wards that gave him his upset victory two years ago. But he also won the normally Republican wards and fared well in the Democratic strongholds.

Sanders, 41, claimed in his campaign to have brought new life to Vermont's largest city, but his opponents portrayed the mayor as a wild man who could ruin Burlington if given two more years in office.

Gilson had ridiculed Sanders' political beliefs in newspaper ads that said: "Socialist principles have not worked anywhere in the world. They won't in Burlington either."

In New York, state Sen. Gary Ackerman won a special election to fill the congressional seat held by Rep. Benjamin S. Rosenthal (D-N.Y.), who died in January.

With all votes counted in the 7th Congressional District, Ackerman, 40, a four-year state senator running on the Democratic and Liberal lines, had 50 percent of the ballots cast.

Accountant Albert Lemischow, running in the Republican, Conservative and Right-to-Life columns, was a distant second, with 22 percent.

Douglas Schoen, a partner in a Manhattan polling and political consulting firm and the Queens Independent Party candidate, was third with 16 percent.

Gloria D'Amico, chief clerk of the Board of Elections in Queens, described yesterday's turnout as "very light." She said about 10 percent of the district's 150,000 eligible voters went to the polls.