Alexandria Mayor Charles E. Beatley, a Democrat, soundly defeated his Republican opponent, Vice Mayor Robert L. Calhoun, yesterday to win his fifth three-year term in an election that Democrats portrayed as a referendum on Reaganism.

Democrats also scored gains on the City Council, capturing four of the six seats; they previously held three.

Beatley received 9,921 votes to Calhoun's 6,864, giving him a 24 percent margin of victory. Calhoun was the first Republican to seek the mayor's office in more than a century, and his candidacy was viewed as a sign of the Republican Party's growing strength in the city.

Beatley, a retired airline pilot, made frequent reference during his campaign to the effect an estimated $2.8 million in federal budget cuts would have on the city. Last night he interpreted the Democratic success as in part a comment on President Reagan's economic policies. "We're the party of inclusion, the party of compassion, and I think this vote had something to do with what's going on over the Potomac river."

Calhoun, a partner in a Washington law firm, conceded shortly after 9 p.m. in a telephone call to Beatley. He and other Republican candidates later appeared at the Democratic celebrations at an Old Town shopping arcade.

"This was an extremely good race given the fact that we've never tried it before. . . " Calhoun said. "There were just a lot of people voting the straight Democratic ticket, and people voting for Chuck Beatley as an institution."

Republican council incumbent Carlyle C. Ring, one of the architects of the local GOP, who hung on to a council seat this time by a margin of less than 600 votes, said the Republican losses were not a referendum on national politics but rather "part of the natural ebb and flow of politics. This was not a particularly good ebb as far as the party is concerned."

Incumbent Democrats James P. Moran and Donald C. Casey, and Democratic newcomer Patsy S. Ticer were the top three vote-getters in the council race. Lionel R. Hope, also a Democrat and the only black candidate on either party slate, came in fifth.

Republican incumbent Marlee Inman came in fourth, while Republican incumbent Carlyle C. Ring came in last. Three years ago, Ring polled second after Calhoun; he was one of the top fund-raisers in this year's campaign.

The top vote-getter--traditionally the one given the largely ceremonial post of vice mayor--was incumbent Moran, with 10,418. PTA activist Ticer got 9,646 votes, followed by incumbent Casey with 9,350. Republican Inman got 8,394 votes, followed by Democrat Hope, with 8,129, and Republican Ring with 7,926.

Democrat Mark Pestronk came in seventh with 7,353 votes, followed by Democrat Richard B. Leibach (6,615), Republicans Gene C. Lange (5,455), Robert M. Gardner (5,231), William M. Glasgow (5,190) and Janet M. Wilson (5,160). Independent Nicholas A. Colasanto polled 2,827, and Bruce T. Adkins received 533. There were 103 write-in votes for former mayor Frank E. Mann.

Calhoun said last night he intends to "retire" from city affairs for the time being. Councilman Ring, asked whether the Republicans would run a mayoral candidate in 1985, said only, "I don't know."

In other Northern Virginia localities yesterday, voter turnout was generally described as higher than usual for local elections. Following are unofficial election results:

Clifton: With voter turnout called heavy--80 out of 113 registered voters--Wayne H. Nickum was elected mayor. Council winners were Robert F. Achor, Kenneth D. Buckley, P. Diane Dygve, Mynor Floyd McIntyre, Frederic Lee Ruck.

Fairfax City: John W. Russell scored a narrow upset over incumbent mayor Frederick W. Silverthorne. Council members elected were Ronald E. Escherich, Carl J. Hemmer, Robert Lederer Jr., Gene P. Moore, Glenn L. White, Lee H. Wigren.

Falls Church: Four candidates ran for four open council seats--incumbents Carol W. DeLong, Robert L. Hubbell and Gary D. Knight plus newcomer Elizabeth L. Cesnik.

Herndon: Incumbent Mayor Thomas D. Rust easily defeated his two opponents. Elected to the council were Robert P. Jensen, Lloyd H. Johnson, Donald M. LeVine, Howard A. Nachman, Richard C. Thoesen and Douglas D. Walker.

Manassas: Incumbent Mayor Edgar E. Rohr won unopposed. Three incumbents won reelection to the council: Robert L. Byrd Jr., James H. Payne, and A. Stewart Vetter.

Vienna: Incumbent Mayor Charles A. Robinson Jr. won without opposition. Council incumbents E. Ross Buckley and Vincent J. Olson won, as did George E. Lovelace. Council incumbent Robert W. Robinson was defeated.