Here in the thinly populated upper tier of New England, two of the most hotly contested Senate races are being fought.

Republicans need to gain nine seats to take control of the Senate for the first time in a quarter of a century, and feel they have a real chance to win back two -- in New Hampshire and Vermont. Democrats say that both their candidates are leading in close races, and expect them to hold on and win.

In several respects the two contests are remarkably similar. Two generally liberal Democrats -- New Hampshire's John Durkin and Vermont's Patrick Leahy -- who won first terms by the skin of their teeth are being challenged by moderate-conservative Republicans -- New Hampshire's Warren Rudman and Vermont's Stewart Ledletter -- who have held appointive state government positions but never before have run for office.

The Republicans tried to label the incumbents as big spenders except on defense, where the Democrats are rated soft for opposing such new weapons as the B1 bomber. All are in their 40s and bear little resemblance to the old stereotype of the taciturn Yankee.

Durkin, 44, won his seat against a conservative House member in a race so close they had to run the election over again. This time he is up against a different sort in Rudman, 49, who as the appointed state attorney general was credited with building a sleepy little office into an active department filled with bright young lawyers working in new areas of consumer rights, the environment and white-collar crime. Rudman gets along easily with people, is hugely self-confident, and likes to recall his days as combat platoon leader in Korea.

Rudman has made out-of-state special interest money the major issue in his campaign against Durkin, who has strong backing from national organized labor groups that are not strong in New Hampshire. Rudman vowed at the start of his campaign to take no money from outside political action committees. A large banner spread across the window of his campaign headquarters on Main Street here proclaims Rudman "a senator we can call our own."

By contrast, Rudman calls Durkin "the third senator from Massachusetts," the neighboring large industrial state whose residents Rudman considers a more compatible constituency for Durkin. Rudman was delighted recently to read an endorsement of Durkin on the editorial page of the Boston Globe.

However, Durkin, a feisty maverick known for his caustic oine-liners and his support of Sen. Edward Kennedy over President Carter in the Democratic presidential primary, seems to have created an image of one who has worked hard for New Hampshire, especially on energy, which is very important in this cold climate.

At a campaign luncheon with senior citizens in Keene, Durkin was approached by one person after another who thanked him for pushing legislation to help the poor pay the skyrocketing price of heating oil. He described himself to the elderly voters as a "moderate, independent, Harry Truman Democrat."

Durkin's break with Carter could help more than hurt him here, where the president is not popular.On the other hand, GOP standard-bearer Ronald Reagan is expected to carry New Hampshire by a wide margin. If the Senate race is as close as the polls suggest, Reagan might pull Rudman in. But observers say a lot of people plan to split their tickets and vote for Reagan and Durkin.

A poll commissioned by the New Hampshire Times and conducted in early October showed Durkin with 40 percent of the vote and Rudman with 33 percent. That survey did not take into account the Reagan factor, and the GOP nominee could make it "nip and tuck," said New Hampshire Times political writer Rod Paul.

Rudman made it through a primary field of 11 candidates to the general election. He managed to recruit the runnerup as his campaign manager and persuade third-place finisher and former governor Wesley Powell not to run as an independent.

Although both Durkin and Rudman deny that this is a grudge fight, there is little love lost between them. Rudman was a member of the commission that overturned Durkin's apparent original victory in 1974. And it is commonly believed that it was Durkin who black-balled Rudman's subsequent nomination by President Ford to be chairman of the Interstate Commerce Commission. Ford has visited the state to speak for Rudman, and Senate Minority Leader Howard H. Baker Jr. (R-Tenn.) was here earlier this month.

Across the Connecticut River in Vermont, tall, spare Pat Leahy, 40, who looks a bit like a preacher, may have a little easier going. Ledbetter, 47, has lived in the state only a decade, but in that time has served as state commissioner of banking and insurance.

Leahy says there is no carpetbagger issue, but he generally includes in speeches a reference to himself as a lifelong Vermonter whose forebears arrived 150 years ago. Ledbetter says he spent summers in Vermont as a boy and always intended to live there, but stopped off in a New York bank to make money when starting a family. He walked 450 miles up and down the state to win the primary.

The two candidates' rhetoric is predictable. In a radio debate in Waterbury, for example, Leahy said that as a senator with seniority on the Agriculture and Appropriations committees he can serve Vermont as a "strong, experienced voice" on rural matters. Ledbetter attacked Leahy's vote against the B1 bomber, which Leahy had denounced as a "gold-plated turkey."

Speaking to workers at a Sears store in Burlington one day recently, Ledbetter called for a balanced budget and said he could cut $35 billion without hurting federal aid programs. A first step, he said, would be to take operators off the automatic elevators in the Capitol.

Leahy has tried to make Republican "dirty campaign tactics" a major issue. He said Ledbetter and other Republicans have distorted his record and says this is not the way Vermont politics traditionally have been conducted.Ledbetter denies that he has done anything dirty, and calls Leahy a "whiner" who has done some distorting of his own.

Part of Leahy's complaint is directed at Republican Rep. James Jeffords, who has no general election opponent and is running around hurling barbs at Leahy. For instance, he says Leahy, who has a strong image at home of supporting equal rights for women, pays female staffers less than men for equal work.

One newspaper in the state decided that Jeffords, who has a liberal voting record, is trying to clean himself up with the state Republican establishment in order to make a Senate run in two years. By contrast, the state's senior senator. Republican Robert Stafford, endorsed Ledbetter but has taken no part in the campaign.

The "dirty campaign" charge by Leahy may be taking hold. As he worked his way through the offices of the telephone company in Burlington, Leahy was told by a woman worker: "I didn't say this to Mr. Ledbetter because it is negative, but I hope his method of handling himself does him in."

A Ledbetter supporter said they had been receiving advice "to get back to issues, that the campaign is too negative."

Leahy is the first Democrat ever to win popular election to the Senate from Vermont. He was state's attorney in the Burlington area, where a quarter of the state's population lives. Vermont still has Republicans as governor, the other senator and the sole House member, but the state is changing politically thanks to party breakdown, television buildup and new residents.

Leahy has worked hard, has been home every weekend and has been a steady leader in the polls. His people say that any Republican in Vermont who doesn't start a race with more than 40 percent of the vote is in deep trouble and that Ledbetter has never climbed above 35 percent.

But Ledbetter says his polls show he has come from far behind last summer to a break-even point now and that he has momentum. And he insists, "I think I have an excellent chance to win."