In a homey dining room in Rockville, while a senior citizen's band tootled "For He's a Jolly Good Fellow" on little kazoos, Edward T. Conroy smiled broadly, humbly thanked his supporters and promised them that "working together we will prevail" in the U.S. Senate race in Maryland.

The scene was a Conroy fundraiser, the guests local Democratic officials, the suggested donation $50 and the take at the end of the long evening last week about $2,500.

A few hours earlier in Georgetown, Conroy's opponent, Republican incumbent Charles McC. Mathias, was holding his own fundraiser. There, in an impeccably manicured garden, Virginia U.S. Senator John Warner stood on a chair to introduce guests like the Elliot Richardsons, television cameras shot the action from overhead balconies and Mathias told his supporters of the need for money in his race in heavily Democratic Maryland.

Guests paid $100 each to attend, and by the time the party was over the Mathias campaign war chest was bulging by another $10,000.

The two little scenes told much of the story of the Mathias-Conroy battle -- a fight between the popular and confident incumbent and the quintessential underdog. While the money and endorsements roll in for Mathias, Conroy is still roving the state in search of contributions, media exposure and even support within his own Democratic Party ranks. The money has been hard to come by, the media exposure meager and the Democratic support sometimes less than enthusiastic.

The 51-year-old Conroy, a Maryland state senator for the past decade, began his campaign last May savoring his position as the long shot in the race. "I'd rather go in as the underdog," he said after winning his crowded primary. "I love underdogs."

Since his election to the Senate in 1968, the liberal Mathias has continued to pierce deeply into the Democratic ranks in a state where registered Democrats outnumber Republicans by 2 to 1.

Now, 17 days before the election, a somewhat haggard Conroy ironically is still having to tell his audiences how he loves the status of underdog.

"I read in the papers this evening that my opponent is outspending me 6 to 1. I'm really not surprised," Conroy told an anti-abortion group last week. "I predicted before the final cash register closed my opponent would spend more than $1 million to defeat me. Well, I believe there's more to running than what money can buy."

Indeed, Conroy has attempted to put together a grass-roots campaign to counteract the billboards, television commercials and mailings that nearly $600,000 has been able to buy for Mathias, who draws support from both big business and labor groups. The Conroy campaign, by contrast, has taken in about $135,000 -- nearly a third of that in loans from the candidate himself.

Television commercials starring the white-haired state senator from Bowie are ready and waiting, as are radio advertisements and a brochure. All Conroy needs is the money to put them on the air or in the mail.

"If only we could get an angel with $100,000 or $200,000," Gus Gentile, Conroy's Montgomery County campaign coordinator, mused at last week's fundraiser. Instead the campaign has about $17,000 on hand and plans for several small fundraisers in the final weeks before the election.

To counteract that disadvantage, Conroy has gone on the attack, attempting, for instance, to cut into Mathias' traditional support in the Jewish community.

In a debate at a Chevy Chase synagogue last month, Conroy could scarely conceal his elation when a questioner rose and said: "Sen. Mathias, in The Washington Post on April 21, 1976, you are quoted as saying 'Arafat is a man of peace.' I would like to know if that is your present position?"

Mathias said that he had been on a trip to the Middle East at that time to get an "overview" of the situation and had met with Palestine Liberation Organization leader Yasser Arafat. Mathias continued: "What I had said was, compared to some of the really wild people who exist in that part of the world, by comparison Arafat was not as bad as some of the others."

(The Washington Post story of that date said only that Mathias had described Arafat's tone at a meeting as "moderate and reasonable.")

Conroy was quick to call the statement, as described by the questioner, "at best . . . naive," and to tell reporters later that "this [Arafat] thing could really turn this election around."

Since then, Conroy has wasted no chance to bring up the remark whenever he appears before a Jewish forum. It has had some impact on the Jewish community in the Washington area, said one prominent Jewish politician, Rosalie Abrams, a state senator who is head of the Democratic Party in Maryland. "But in Baltimore," she said, "people feel Mac [Mathias] has been good on the Middle East."

Though Conroy has failed to catch fire with any new issue in his quest for votes, two old standbys -- the veterans and anti-abortion groups that Conroy has made a career of championing in state government -- are relentlessly working for his election.

"He's our top man," said Jerry Meyer, head of the Maryland Right to Life group that cheered Conroy at its convention Friday night.

And another group, Pro-Life Families for Conroy, has sent letters to thousands of voters throughout Maryland extolling Conroy's voting record and calling for donations. "We have no paid staff, no political fat cats we can appeal to. We only have you," one of their letters says. "And together we may be the only hope for thousands of unborn children."

Despite his conservative stance on abortion and his calls for more military spending. Conroy for his 18 years in the state legislature has received high ratings from labor groups and has voted for many human rights issues.

Perhaps this is one of his biggest problems in this uphill battle against liberal Republican Mathias. "Other than defense and abortion, where do Ed and Mathias really disagree?" asked one of Conroy's Democratic boosters.

Conroy continues to travel the state, calling himself a "fighter" at his campaign stops and asserting that he will not quit.

When Mathias is the scheduled speaker at a state teachers union convention, Conroy still shows up, pumping hands in the hallways and introducing himself to the members as they walk by.

Perhaps the most telling comments came at a "unity breakfast" for elected officials in his native Prince George's County, where Conroy amassed his victory margin in the primary.

"All of you, please help," Conroy's state chairman Robert Brady Jr. told the quiet crowd of officeholders. "Don't give up on this campaign. A lot can happen in the last few weeks."