The Soviet Union yesterday put two cosmonauts into earth orbit in an attempt to revisit the Salyut 5 space station, considered by Western space observers to be a military version of the Salyut spacecraft.

The official Soviet news agency Tass said that the cosmonauts of Soyuz 24 left the Baikonur cosmodrome in Soviet Central Asia at 11:12 a.m. EST on the first leg of what Western space watchers believe will be a two-month stay in earth orbit, assuming the cosmonauts dock safely with the orbiting Salyut 5.

"The onboard systems of Soynz 24 are functioning normally and the crew feels well," Tass said. "The cosmonauts have started fulfilling their flight program."

Aboard Soyuz 24 were air force Col. Viktor Gorbatko, 42, and Lt. Col. Yuri Glazkov, 37. The all-air force crew was one indication to Western observers that Soyuz 24 is a military mission. The other indications are that Tass did not give as much space to the flight as it has given to other Soyuz missions and did not describe the experiments the cosmonauts are to do.

Gorbatko has been a cosmonaut for 17 years, flying in space once before aboard Soyuz 7 in 1969. Glazkov has trained as a cosmonaut for 12 years, but was making his first orbital voyage.

Both pilots are trained to make walks in space, strongly suggesting that one or both will maneuver outside the Soyuz or the Salyut during their coming mission. Gorbatko was a backup pilot on both flights in which cosmonauts walked in space. Glazkov did the equivalent of his doctorate thesis on the mechanics of body movement in the weightless state of space.

The cosmonauts would be the first men aboard Salyut 5 since the Soyuz 21 mission eight months ago. An attempt was made by the Soyuz 23 cosmonauts last October to revisit the station, but they returned to earth in two days after failing to rendezvous with Salyut.

Like the Soviet Union's earlier Salyut 3 space station, Salyut 5 is believed to be a military version of a 20-ton space station.