Democrats retained control of the 39th District seat in the Virginia House of Delegates yesterday as Alan E. Mayer, a retired federal government worker, handily defeated Republican Robert E. Dively Jr.

Mayer, 60, swept all 15 precincts in the district, located in the Annandale area of Fairfax County, getting 3,823 votes to Dively's 2,522, according to totals provided by the Fairfax County Electoral Board. Only 21.5 percent of the district's registered voters turned out for the special election, a figure that political observers attributed to yesterday's snow and low temperatures and to voter apathy.

Mayer will replace Vivian E. Watts, who resigned three weeks ago to become secretary of transportation and public safety in Gov. Gerald L. Baliles' cabinet. Watts had been elected to a third term in the General Assembly just two months ago.

Mayer, scheduled to be sworn in in Richmond tomorrow, said after the returns were in: "Obviously I've got a lot to learn fast." He said he received a congratulatory telephone call from Baliles and that he told the governor "I'd report to duty tomorrow."

Mayer added, "I'll be working with the governor's team," sounding the theme that highlighted his two-week campaign, which was dominated by radio advertisements in which he promised to follow the path taken by Watts during her four years in Richmond.

For Mayer, a retired Central Intelligence Agency employe, the victory came on his first try at elective politics. Before the campaign, the Lincolnia resident was known chiefly for his involvement in a wide range of civic issues.

Dively, a 27-year-old North Springfield attorney and vice president of the Fairfax County Young Republican Club, did not return telephone calls placed to GOP headquarters in Annandale last night.

Like Mayer, Dively emerged three weeks ago from relative obscurity to seize his party's nomination for the race to succeed Watts. He defeated Louis L. Guy, the choice of Republican elected officials in Northern Virginia, largely by bringing out antiabortion activists to the GOP nominating caucus.

He later accused Mayer in a campaign letter of ducking the abortion issue by contending that abortions should be a matter of personal choice.

Officials in each party agreed last night that the abortion issue had no discernible effect on the election.

Ben Partin, chairman of the Fairfax County Republican Committee, said he was "terribly disappointed" by the defeat, the fourth straight his party has suffered in contests for the 39th District seat.

Partin asserted that the Democrats were aware of the Watts appointment weeks before it was made and thus had a head start on the Republicans by the time the campaign began. He said the state Democratic Party increased its advantage by scheduling a two-week campaign that increased difficulties for the Republican candidate.

That charge was denied by Lawrence H. Framme, a vice chairman of the Virginia State Democratic Committee.

He said Democrats in the Fairfax area "did not know Vivian Watts was going to be taking that post until it happened."