Though Iran's Ayatollah Ruhollah Khomeini has put his army on "alert" and called for the overthrow of Iraq's government, Iran's once-powerful military forces would probably lose an all-out struggle with their heavily armed Islamic neighbors to the west.

That is the cautious assessment of U.S. specialist monitoring the escalating war of words between Teheran and Baghdad, and now reports of skirmishes along the 80-mile Iran-Iraq border.

Iran's military machine -- in the shah's day the most awesome in the Persian Gulf region -- has deteriorated in the year-long turmoil that began with his ouster.

Purges of officers and desertion in the ranks have brought the army down to what U.S. specialists believe is now less than half its former size.

Many of the sophisticated jet fighter planes and big warships bought from the United States in the mid-70s can't fly or sail for lack of maintenance, spare parts and skilled technicians. Even when planes do get into the air, sources say, the complicated missile and bombing systems that make them effective can't always be operated.

The deterioration of Iran's military strength has basically allowed Iraq, equipped with a Soviet-supplied tank corps that is the largest in the Arab world, to emerge as the dominant combat force in the region in terms of land armies.

Nevertheless, the U.S. assessment of how things would end in an all-out war -- which specialists here do not yet believe is likely -- is cautious for several reasons.

For one thing, U.S. Intelligence information on the region is sharply reduced from the days under the shah when there were 1,000 U.S. military advisers in Iran and thousands of technicians and other Americans in the area.

Second, both countries under their present rulers are extremely secretive, with decisions flowing much more from the personalities of Khomeini or Iraq's President Saddam Hussein than from Western-style military logic. o

Perhaps important is that neither force has been tested or has a good track record in combat, so that sheer statistics about armament can be misleading.

The last major outing for Iraq's Army was the 1973 Arab-Israeli war. Iraq's forces have been built up greatly since then, but in that war a brigade-size Iraqi expenditionary force was quickly and badly mauled by Israeli forces in Syria.

Iranian troops turned in a mixed performance helping put down a lightly armed rebellion in Oman's Dhofar province in the early 1970s.

U.S. analysts believe Iran's military today cannot defend the country's borders against any determined attacker, nor could it sustain a heavy battle for more than a few days to perhaps a week or two.

Political instability also is inhibiting the army from playing a substantial role in handling dissent or pockets of rebellion with the country, these specialists believe. In this view, many professional soldiers are reluctant to fire on elements of the population such as rebellious Kurds, because of fear that, under a different regime, they could be vulnerable to charges of political murder.

Even if the government wanted to take control of the U.S. Embassy hostages from the militant students under conditions of some tension, sources here believe the army would not be likely to do it. Khomeini would have to call on portions of the roughly 20,000- to 30,000-man Revolutionary Guard, the paramilitary force that basically protects the ayatollah's revolution.

Because the army had been most involved of all the services with internal security under the shah, it has been riddled most heavily by purges and defections. From it prerevolutionary size of some 285,000 troops, U.S. analysts estimate it is now down to about 120,000 to 130,000 men.

There are virtually no army generals or navy admirals that survived the revolution within the military, sources say, so trained leadership, discipline and the ability to control units has decreased.

Upheaval was most severe in the early months of the 1979 revolution, by U.S. specialists say the Iranian army actually has improved faster from that low point than analysts here had expected.

Much of the army communications system is still intact and the army has shown itself able to move into outlying provinces.

The army can still move some of its tank force, built around almost 900 British Chieftain tanks, but many of the tanks are believed to be either out of operation or unable to operate their guns or fire control systems effectively.

Iran still has four of its seven army divisions near the Iraqi border and thus far shows no sign of moving reinforcements to that area, sources said.

Those four divisions -- two infantry and two armored -- are among the best Iran still has, with one armored division at Ahwaz, near the oil fields in the southwest, and the other at Kermanshah further north along the border, rated as the most able to fight effectively.

The air force, less involved with prerevolutionary internal security chores, has also been less affected by desertions and probably has lost only 10 to 15 percent of its prerevolutionary strength, plus its generals.

There is said to be internal dissension, however, among many educated air force technicians whose revolutionary fervor in the upheaval has not won them much influence in the post-revolutionary days.

The 76 highly advanced U.S. F14 jets sold to the shah are said to be virtually useless and grounded without U.S.-made spare parts, maintenance and flight training. Specialists here say there is no sign the Iranians have let the Soviets have a look a the planes or the highly advanced Phoenix missiles that go with them.

Of the almost 190 older U.S. F4 Phantom fighter-bombers in Iran's arsenal, U.S. analysts estimate no more than 40 to 50 percent are flyable and the missile or automatic bombing systems probably could not be operated effectively. Some F4s, however, are reportedly being flown on occasional sorties.

Readiness is highest among the 160 or so simpler and easier-to-maintain U.S. F5 fighters, but these are the least capable combat planes.

Iran's fleet of more than 800 U.S.-supplied helicopters are more affected by lack of spare parts and maintenance, with some estimates of readiness a low as 5 percent. U.S. sources, however, say that is probably too low an estimate.

The Iranians were able to get some of their helicopters down to flood-ravaged areas in the south last month, but U.S. sources say the embargo of spare parts has hurt severely and that U.S. allies also appear to be taking part in the embargo of spares for military equipment.

The navy has been least affected by the turmoil, except for the lack of admirals, and its size is estimated to be only slightly less than the prerevolutionary 30,000.

A few months ago, one of Iran's biggest warships, a frigate, went to the aid of a Greek tanker on fire in the Persian Gulf, but in recent months, the navy has been operating only smaller patrol craft. The feeling here is the ability of the navy to fight with real firepower has been severely downgraded.

Similiarly, the nationwide deployment of the U.S.-built Hawk antiaircraft missile was started but never completed before the revolution. Specialists here believe the operation of the highly complex radar and missile system combination would be limited at best. This could be important if the U.S. ever undertook air strikes against Iranian targets.

In the meantime, Iraq's 200,000-man ground army has been equipped with almost 2,000 Soviet-built tanks and is widely viewed as the best equipped and disciplined force in the region. Most importantly, the armed forces have not gone through the turmoil of those of Iran.

Though the United States does not have diplomatic relations with the regime in Baghdad, which is viewed here as extremist on Middle East issues, informal relations with Iraq have improved in recent years to a stage that State Department officials describe as "correct but limited contact."

The Iraqis have also turned away somewhat from the Soviet Union during that same period, becoming less isolated from the West and the nonaligned world as their own oil wealth and influence expands.

Iran and Iraq have been feuding for a number of years, mostly over Iraqi claims to three small islands in the Persian Gulf that Iran occupied in 1971. In recent months, there have been numerous reorts of small military clashes and assertions from Baghdad that Iranians were stirring up trouble in Iraq and were responsible for bomb blasts in the Iraqi capital that recently killed several people.

Paradoxically, even though Iraq has been one of the toughest critics of U.S. policy in the Middle East, Iran under the ayatollah is now accusing Iraq of being a U.S. puppet in practice because of Baghdad's action toward Iran.

There were also press reports yesterday that small, armed groups of exiled Iranians opposed to Khomeini were forming in Iraq with the acquiescence of the Iraqi government. These reports were confirmed yesterday.

These groups are supporters of Shahpur Bakhtiar, the last Iranian prime minister left designated by the shah. Bakhtiar left Iran early in 1979 and has been living in Paris since then.

Last night, presidential adviser, Zbigniew Brzezinski sharply repudiated what he called the "lunatic assertions" from Tehran concerning alledged U.S. involvement with Iraq. He also said the United States might have to take "appropriate measures" if Iran and Iraq got into a war that threatened to widen into a major conflict.