A group of 35 Montgomery County high school students corralled a Reagan administration official on a busy Capitol Hill street corner yesterday and grilled him about President Reagan's stance on El Salvador.

The official, Sam Bartlett, a State Department expert on Latin America who had just finished speaking to the group in a nearby building, had trouble getting away from the continued barrage of questions.

Two hours later, sitting under a giant elm on the Capitol's east lawn, the same group was quizzing the Rev. Robert Drinan, a Roman Catholic priest who is a former liberal Democratic congressman, on everything from abortion and birth control to how to solve the political problems of the Middle East.

It was all part of a Congressional Week in Washington sponsored by Democratic Rep. Michael D. Barnes for high school juniors from his Montgomery County congressional district.

"These kids," said Barnes as he walked back to his office after an outdoor brown-bag lunch and two-hour talk with them, "are better informed than some of my colleagues up here."

Yesterday, students, displaying the zest for learning and unnerving candor of youth, were busy in their third day of a series of talks with members of Congress, Capitol Hill lobbyists and experts on everything from arms control to El Salvador.

The students, a decidedly liberal group, were favorably impressed with much of what they saw, but certainly not with all of it.

"It's scary, really scary that people up here are worrying about a lot of stupid details instead of things like . . . whether we're going to end up fighting a war in El Salvador," said David Gerwih, a student at the Jewish Day School of Greater Washington.

Gerwih and Dan Rosenberg of Walt Whitman High School had wandered into a hearing this week of the House Armed Services Committee, in which witnesses and a few congressmen were arguing about something called FROD, which means a functionally related observable difference, according to the two students.

"It really upset me that this is what they were doing," said Gerwih.

W. Dale Bell of Bethesda Chevy Chase High came away having learned a quick lesson in where the meat and potatoes work of lawmaking is done.

"When we watched the House in session . . . it was like acting. The cameras were there, and the congressmen were playing to them," said Bell. "But in committees, it was real work. They listened, they asked questions, they argued."

Most of the students described themselves as liberals, but not all had the same reaction to Sen. Paul Sarbanes (D-Md.), one of the Senate's most liberal members, who spoke to them on the steps of the Capitol Wednesday.

"Sarbanes kept criticizing Ronald Reagan," said Andrew Kramer of Springbrook High, "but what he didn't do was tell us what he's going to do about all these problems."

Whatever their impressions, at least a few left yesterday feeling that they too would like to become members of Congress someday.

"I don't want to pull any punches," said Kramer dead seriously, although the line drew some laughter from his fellow students. "I think I could serve the nation well.'

And David Draper, of Paint Branch High School, while denying he has any political aspirations, was already acting like a politician.

"What paper are you from?" he asked a reporter. When the reply came, "From The Washington Post," Draper thrust out his hand, introduced himself and said, "Draper, D-R-A-P-E-R, make sure you spell it right."