The United States has been secretly mediating between Israel and Syria in an attempt to ease tensions and reach an agreement over their respective military forces in southern Lebanon, according to U.S. officials.

The U.S. mediation between the two adversaries, who have fought four wars and recently appeared on the verge of another clash, has been conducted mainly through embassies in Damascus and Tel Aviv, including at least one trip by Assistant Secretary of State Richard W. Murphy to Damascus in early April.

Washington specifically has sought stability in southern Lebanon by reviving the nearly moribund U.N. Interim Force in Lebanon and by seeking pledges of military restraint from Israel and Syria, a State Department spokesman confirmed.

The rising tensions between Israel and Syria were touched off in part by an apparent Syrian attempt to reestablish the so-called "red line," which once marked the southernmost limit of Syrian forces in southern Lebanon.

The Syrians have dug "defensive" artillery and tank revetments -- though without attempting to position any equipment thus far -- near Lake Karoun at the southern end of the Bekaa Valley, close to the same positions they held before Israel's invasion of Lebanon in June 1982. The Israeli offensive that summer pushed the Syrian Army eight to 10 miles northward in the Bekaa.

The Israelis fear it is only a matter of time before the Syrians will try to creep southward, thereby reestablishing a new "red line" in the Bekaa and possibly elsewhere in southern Lebanon.

One U.S. source said the new Syrian revetments actually appear to be "a couple of miles" north of their old positions.

U.S. officials say Syrian president Hafez Assad has resisted agreeing to any boundary for his forces in southern Lebanon, a position that has complicated efforts to mediate between the two adversaries.

Nonetheless, the war fever that built up over the past two months has now cooled considerably, U.S. officials said.

The U.S. effort has also been complicated by the uncertain fate of UNIFIL's 5,800-man peacekeeping force in southern Lebanon. UNIFIL's latest U.N. mandate has a term of three months rather than six, and expires July 19. The nine nations contributing troops are demanding a clarification of UNIFIL's mission before continuing their support.

A U.S. official said Israel, Syria and the Soviet Union have all urged renewal of UNIFIL's mandate, with the Soviets offering for the first time to help pay the force's expenses.

Congress ended all U.S. financial support for UNIFIL in April. The administration has requested $42 million for the next fiscal year, but prospects remain uncertain.

The larger cause of renewed tensions is an Israeli perception that Syria is steadily narrowing the technological gap in the military capabilities of the two armed forces through the arrival of ever more sophisticated Soviet arms, the production of chemical weapons and a relentless Syrian drive for "strategic parity."

U.S. and Israeli military analysts agree that Syria, while still behind Israel in the overall military balance of power, is steadily gaining strength and poses a real threat to Israeli security.

These military experts also say they believe the Israeli armed forces are still recovering from their debilitating war in Lebanon and that Assad perceives an Israeli military weakness.

Syria has built, with Soviet help, a highly sophisticated national air defense system with a vast array of SA2, SA3, SA5 and SA6 medium- and long-range anitaircraft missiles. The new Syrian system, U.S. military analysts say, is set up to include an additional autonomous network of SA7, SA8, SA9, SA13 and SA14 missiles the Syrians can fall back on if their main air defense system is knocked out.

The Soviets have also sent Syria 1,000 to 1,500 T72 heavy tanks to replace aging T54s and T55s. Syria now has 4,200 tanks compared with Israel's 3,600, according to the London International Institute for Strategic Studies.

The most controversial new Soviet weapon operated by Syrians is the short-range, surface-to-surface SS2l missile. Syria has 18 to 24 SS21s capable of carrying either cluster bombs or high explosives, in addition to older surface-to-surface Frogs and Scuds, according to Israeli and western estimates. Israeli officials also say it is likely that longer-range SS23s capable of hitting targets anywhere in Israel will arrive in the late 1980s. Some analysts say they believe such weapons make a preemptive Israeli strike more likely.

One Israeli concern is that Syria will use its surface-to-surface missiles to knock out Israeli airfields in the first hours of any new war, thus denying Israel -- at least initially -- the use of its vastly superior air force.

"If there is a danger of an Arab attack, Israel will be forced to strike first because it will not be able to take the risks of waiting and absorbing an Arab [missile] attack," said Seth Carus, senior military analyst for the American-Israel Public Affairs Committee, in testimony before the Senate Armed Services Committee Jan. 30. "The absence of a viable defense against tactical ballistic missiles will leave Israel with no alternative."

A Pentagon source said the arrival of SS23s "could definitely change the military equation" and predicted Israel "would probably go in and take them out." But he said the United States had seen no indication that the Soviets were about to send this weapon to Syria.

Israeli and U.S. military experts say the most likely new addition to the Syrian arsenal will be the MiG29, a late-model Soviet ground attack plane that only India and Syria will have outside the Soviet bloc.

Syria has 60 MiG29s on order, and the first of them are expected to arrive late this year or early in 1987, according to one pro-Israeli military expert. The first Syrian pilots went to the Soviet Union for MiG29 training about two months ago, he said.