U.S. Marines evacuated two endangered posts on the edge of a Shiite neighborhood in the southern outskirts of Beirut today after heavy fighting there yesterday and last night wounded four U.S. marines.

Marine spokesmen said several Marine positions in and around the Beirut airport had been caught in the shelling and shooting for nearly 12 hours yesterday and during the night, the longest period of sustained fire they have experienced.

The decision to evacuate two of seven remaining outposts to the east of the Marines' airport perimeter was made as the Lebanese Army appeared to be on the verge of another confrontation for control of the southern suburbs with Shiite Moslem Amal militias. The Shiites last night captured 30 Lebanese soldiers and surrounded another 100 in a small Christian enclave there.

The soldiers were later freed, but the Army tonight laid down another heavy barrage of artillery fire on the Shiite-controlled neighborhood of Burj al Barajinah, where the situation remains unstable.

Meanwhile, there was no further movement toward a cease-fire in the nearly three-week-old war between the Lebanese Army and Druze militia forces, which have also been battling the Christian Phalangist militia for domination of the mountains overlooking the capital.

Observers here doubted much progress would be made until Syrian Foreign Minister Abdel Halim Khaddam meets U.S. Secretary of State George P. Shultz next week.

In the midst of sporadic nearby shelling this afternoon, a delegation of 10 congressmen from the House Armed Services Committee, led by Samuel S. Stratton (D-N.Y.) and William L. Dickinson (R-Ala.), made a four-hour visit to the Marine headquarters at the airport.

The congressmen were reported before coming here to be in opposition to a continued Marine presence in Lebanon without President Reagan agreeing to invoke the War Powers Resolution. But neither Stratton nor Dickinson would say here today that they were in outright opposition to the president.

Stratton said he was "keeping an open mind" after finding Marine morale was "very high and very good." Dickinson remarked that "the jury is still out."

Marine spokesman Maj. Robert Jordan said two outposts known as Checkpoints 35 and 69 bordering the Shiite district of Hay Sellum had been abandoned today because they had become "tactically irrelevant" and difficult to supply or reach in times of shooting.

One marine who was wounded by shrapnel in the buttocks at Checkpoint 69 yesterday afternoon could not be evacuated until this morning because of the post's isolation.

The two evacuated checkpoints had been important last winter, Jordan said, to help mark the blurred American and Israeli lines, but with the Israeli pullback from the Beirut area, they were no longer needed.

But the continuing danger that the two isolated posts faced from Amal militiamen was seen as the immediate reason for their evacuation.

Heavy Lebanese Army shelling of the Shiite districts of Burj al Barajinah and Hay Sellum continued throughout most of today and at one point a Marine C46 transport helicopter flying over the area opened fire after it was shot at.

Marine spokesman Warrant Officer Charles Rowe said the helicopter was "deep in ground fire but was not hit" after taking off from another Marine position at the Lebanese University school of science and heading across Burj al Barajinah on its way back to one of the U.S. supply ships offshore.

With a jeepload of American reporters, I watched the helicopter firing its .50-caliber guns shortly after noon as it skimmed across the battle zone where huge columns of smoke from 155mm shells were rising.

We saw the incident from another embattled Marine checkpoint, 76, just outside the airport where most of the 1,200 U.S. marines are dug in.

Checkpoint 76, manned with the Lebanese Army, was under fire last night and one of the four Marine casualties occurred there.

The post is on the only road still open to the Druze-controlled town of Shuwayfat and is important to Druze, Shiites and the Lebanese Army because it controls a main access route from the mountains into the southern suburbs of Beirut.

Staff Sgt. Manusamoa Fiame, the Marine platoon commander at Checkpoint 76, said the shelling around his position last night was "probably the closest" to what he had experienced during an 18-month stint in Vietnam. The shelling, he said, had come both from the east where the Druze are holed up in Shuwayfat and northeast where the Amal militia is entrenched.

"It's pretty hard to find out who is shooting at you," he said. "I have no idea who are the good guys and who are the bad guys. That's what I'm trying to find out."

About 60 marines were evacuated from the two checkpoints nearest Hay Sellum and transferred to the Marine base at the science school but there were reportedly no plans to abandon Checkpoint 76, which is closer to the airport and not near any populated area.

There are about 200 marines at the science school, which is cut off from the airport by Hay Sellum and supplied now only by helicopter because of the dangers of passing through the Shiite neighborhood.

The marines there and at Checkpoint 76 are in danger of being caught in crossfire between the Lebanese Army and Shiite and Druze militias fighting for control of the southern suburbs.

Today, the battle centered on a Christian enclave at Mreije where Amal militiamen fought the Army and Phalangist forces.

Amal spokesmen accused the Army of violating an agreement over its presence there when 100 soldiers instead of the agreed 30 showed up under a new commander yesterday morning and also brought in more Christian Phalangist militiamen.

Amal said the Phalangists killed 11 members of a Shiite family last night and that this led to the nightlong battle between the Army and Amal militiamen. By this morning, 30 soldiers had been captured, a captain killed and 100 to 150 other soldiers surrounded in Mreije. The Phalangist militiamen were driven away, they said. But the situation there remained unsettled.

Afek Haidar, a top Amal commander, told reporters the Lebanese Army had surrounded Burj al Barajinah and Hay Sellum with 4,000 troops and said his men were "in a very difficult position."

Last month, Amal militiamen battled with the Army in west Beirut but then retreated into the suburbs. The Army stayed out of the suburbs after an agreement was reached but Amal has been preparing for battle against the Army ever since. Tonight, the Army appeared determined to cut the Shiite suburbs off from access routes to the mountains.

Haidar, asked why Amal militiamen were firing at the Marines, said it was because their positions were "very near the Lebanese Army, only 10 yards away."

"I think it was a mistake," he said adding, "I'm not saying all the membership of Amal is ideal. Sometimes things happen."

His comments seemed to confirm the impression of many here that the top Amal leadership is not always in control of the militiamen.

The Marines, in returning the fire, reportedly shelled the Shiite neighborhoods again last night. Shiite anger over this was conveyed to U.S. Ambassador Robert Dillon today by Amal leader Nabih Berri, state television said.