Two high-ranking Soviet diplomats have been asked to leave the United States and a third Soviet official left voluntarily after they were caught in what the FBI said were unrelated espionage activities here and in New York.

U.S. officials said yesterday that the acting military attache at the Soviet military office here was caught last Saturday evening as he removed rolls of film from a "dead drop" at the base of a tree in rural Montgomery County. The FBI said Yevgeniy Nikolayevich Barmyantsev, 39, a lieutenant colonel in the Soviet army and a military intelligence officer, was "known to be involved in" efforts to obtain classified and sensitive U.S. military and technology information. Barmyantsev's predecessor as military attache was expelled for espionage last year.

In a second incident, the State Department notified the Soviet mission to the United Nations on Wednesday that Aleksandr Nikolayevich Mikheyev, 44, was being expelled for trying to obtain highly classified information from an aide to Rep. Olympia J. Snowe (R-Maine), FBI officials said. State Department officials said Mikheyev is thought to have left the country already.

U.S. officials said the third Soviet accused of spying was Oleg Vadimovich Konstantinov, an intelligence officer attached to the Soviet U.N. mission. FBI agents said they caught Konstantinov, 33, in Manhasset, Long Island, on April 2 when he met an American from whom he was trying to get secret information about U.S. weapons technology and the U.S. aerospace industry. The American, whose name was not disclosed, "has operated under the control of the FBI for several years," an FBI spokesman said.

The Reagan administration's unusual decision to announce the expulsions in the press apparently was partly in response to the Soviets' highly publicized expulsion last month of Richard Osborne, a first secretary at the U.S. Embassy in Moscow.

"Although there is no connection between the expulsions themselves, we took into consideration the Soviet decision to publicize the Osborne case, in deciding to announce these cases," said a State Department official.

State Department officials would not comment on whether there has been an upsurge in Soviet spying activity here, but Soviet spies have been expelled in several Western countries this year, including Italy, West Germany and Canada. France expelled 47 Soviets earlier this month.

One official said "there is no justification for the Soviet side to retaliate" for the three expulsions this month.

The FBI said Barmyantsev, the military attache who came to the U.S. for his third tour here in May, 1981, was caught while removing eight rolls of undeveloped 35 mm film from a green plastic bag at the base of the tree. The film contained photos of classified U.S. documents, according to the FBI.

The FBI provided few details of how or where he was apprehended, but residents of the Boyds area of Montgomery County said the arrest occurred in a field at the intersection of Schaeffer and White Grounds roads, near Little Seneca Regional Park.

Janet and Angus Jordan of 15520 Schaeffer Rd. said the FBI had blocked the road near their home about 7:45 p.m. Saturday. Janet Jordan said a man in street clothes came to their car and announced that "we are in pursuit of an arrest."

FBI agents released Barmyantsev at the scene after verifying that he enjoyed diplomatic immunity. On Tuesday, the State Department officially declared him persona non grata, which requires a person with full diplomatic immunity to leave the country. U.S. officials said Barmyantsev has left already or will leave soon.

The FBI said Mikheyev approached Marc E. Zimmerman, a legislative aide to Rep. Snowe, who is a member of the House Foreign Affairs Committee. Zimmerman immediately contacted the FBI and thereafter, with Snowe's approval, met twice with the Soviet diplomat. According to the FBI, Mikheyev was seeking a highly classified document with information about U.S.-Soviet relations.

Zimmerman, 29, an expert in foreign affairs and the Soviet Union, said last night that he met Mikheyev through a mutual friend in New York, who suggested that the Soviet diplomat contact Zimmerman if he was ever in Washington. About 10 days ago, Zimmerman said, Mikheyev called from New York to set up what Zimmerman thought would be a social luncheon. Zimmerman said he called the FBI, however, because he was not sure about how to treat meetings with Soviet visitors. He said he was under the impresssion that Mikheyev was in the U. S. to study agriculture and business.

Zimmerman said Mikheyev came to Snowe's office and the two went to lunch at a Capitol Hill restaurant.

"We contrasted and compared life styles in the U. S. and the Soviet Union," Zimmerman said. "He was very personable, that's the sad thing about it."

Zimmerman said that later in the conversation, Mikheyev said he thought the two countries were on a collision course because of disagreements about nuclear weapons. He said Mikheyev told him there were already documents within the U. S. government about how the U. S. was trying to destabilize the Soviet Union. Zimmerman said he responded that those documents would be highly classified.

"'Find out what you can,'" Zimmerman said Mikheyev told him. "'But don't get yourself in trouble."

Zimmermanm said that Mikheyev manipulated the conversation very well and that the subject came up as if naturally in the context of their discussion.

After the lunch, Zimmerman said he went to the FBI and "told them everything and that that raised a few eyeballs." They instructed him to meet Mikheyev again and a dinner was arranged a few days later.

The FBI said yesterday that conversations between Zimmerman and Mikheyev were tape-recorded.

At the dinner, at a different Capitol Hill restaurant, Zimmerman said the subject of the document came up again and "I told him four times throughout the meal, 'Jesus, it's classified.'" When Zimmerman asked for the check, he said Mikheyev would delay him and order more beers. Again, Zimmerman said, Mikheyev told him to "find out what you can," and said he might be back in Washington on April 19.

Zimmerman said he found out a day or two ago that Mikheyev had been ordered expelled.

Mikheyev reportedly is attached to the Institute of the U.S.A. and Canada, also known as the Arbatov Institute, in Moscow. He was on a three-month tour of duty at the U.N. The State Department said he was ordered expelled "for activites incompatible with his status." He was not declared persona non grata because he is attached to the U.N., rather than assigned in the U.S., and had diplomatic immunity only "for activities in his official capacity," a State official said.

The third Soviet spy, Konstantinov, was a KGB intelligence officer who first came to the U.S. in 1979 as an attache at the U.N. mission, where he held the rank of third secretary. The FBI released him after he identified himself as a diplomat. State department officials said he left the country before he could be for he could be ordered expelled.

Soviet ambassador Anatoly Dobrynin was reportedly summoned to the State Department late yesterday afternoon, but one official said, who could not confirm the visit, said it was unlikely he had been called in yesterday for events that were several days old.

At the Soviet military office on Belmont Road, an employe answered the door and said there would be "no comment" on the expulsions.