The current conduct of the once much-ridiculed Lebanese Army is providing a rare, if tenuous, source of cautious optimism in Lebanon's otherwise familiar pattern of disorder and disintergration.

Measured against other armies -- or against its own inability to enforce government sovereignty over most of the country -- the Lebanese Army may not look like much. But survival of any official institution is regarded as a victory amid the rubble of Lebanon. Survival of the Army in particular is regarded as essential if the government is ever to regain control of its territory.

Deployed in increasing numbers with United Nations troops in the south, separating opposing Syrian Army troops and Christian militias in the central mountains and taking almost daily punishment along the confrontation line separating this divided capital, the Army today looks better than at any time since it split into warring factions in the 1975-76 civil war.

But there are still grave doubts about its solidity if it is called on to police the elaborate truce that Amercian presidential envoy Philip C. Habib is trying to work out to avoid a major Middle East conflict between Syria and Israel over the stationing of Syrian surface-to-air missiles in Lebanon. The doubts are based on the simple truth that the 25,000-man force is still convalescing from the self-inflicted wound administered in the 1976 split, when its men joined Christian or Moslem forces and its officers became the officers of Christian and Moslem militias.

"The war of two armies" presently pitting the Lebanese military against the Syrians of the Arab Deterrent Force -- both nominally report to Lebanese President Elias Sarkis -- would not be considered a great feat of arms in most parts of the world.

Military specialists nevertheless are surprised and delighted that the Lebanese troops have stood their ground. Mixed Moslem and Christian units have stayed intact despite of vagaries of positions placing them cheek-to-jowl alongside better armed rightist Christian militias in the capital.

Damage to Lebanese barracks, military hospitals and other installations bears witness to the Syrians' efforts to drive the Lebanese Army out.

Still, there are limits to even offical optimism. Army spokesmen acknowledge that recruiting has dried up since the current fighting -- and its casualties -- began.

In this country where religious remains the principal reality, analysts greatly feared that Christian oficers and men would desert to defend the eastern Christian city of Zahle during the height of fighting there several weeks ago between the Syrians and the rightist Christian militias.

Even optimists convinced that the United States was correct in spending $100 million to rebuild a 25,000-man Army as the best way to restore shattered state structures are crossing their fingers. The principal cause of concern is President Sarkis' awkward situation, in which he theoretically commands both his own national Army and the 22,000 Syrians of the Arab Deterrent Force established with Arab League blessing at the end of the civil war in 1976.

So far a pious fiction has been maintained that the Lebanese Army is not fighting the Syrians, but rather the Palestine Liberation Army, which is a theoretical adjunct of the Palestine Liberation Organization but under direct Syrian operational control.

The Lebanese Army's comportment so far has also undercut Israeli officials' claims that it is a creature of the Syrians.

Whether Syria and Syria's Lebanese Moslem allies will end up accepting an independent Lebanese Army role -- and its implications for the future -- remains unclear.

Only last October the deep-seated need for law and order felt by many Lebanese of all faiths received a rude shock when the Army was felt to have let them down. Army units in the Beirut suburb of Ain Remmaneh stood aside -- and in some cases actively collaborated -- when the largest Christian militia loyal to Bechir Gemayel drove a rival Christian outfit out.

So far independent analysts find little evidence of outright collusion between the Lebanese Army and the Christian militias, although militiamen are known to be positioned to move in if the Army gives ground.

In the crucial mountain fighting for control of the ridge line overlooking the Bekaa Valley to the east and the Christian heartland to the west, the Army was brought in partly to protect the Christian militias from attacking Syrians. But orders to do so came from the presidential palace with the Army command's approval.

Right now the Lebanese Army's cohesion is based on facing a common -- and foreign -- adversary. Indicative of the Lebanese Army's limits and the depth of Syrian suspicions was a Syrina condition that Damascus alone should choose and command any Lebanese unit sent into Zahle as a buffer force.

Recently the government has taken advantage of the lull in fighting in southern Lebanon, brought about by the larger Israeli-Syrian missile crisis, to bring its strength there up to 1,500 men. That is the limit set by the 1949 armistice with Israel and represents the largest government presence there in five years -- even if the troops are stationed amon United Nations peacekeeping force units rather than as an independent force.

Even gung-ho Army officers, who are convinced only a united Army can rebuild a united nation, say they need at least four or five more years to finish rebuilding the armed forces.