Shah Mohammad Reza Pahlavi released two top leaders of the National Front opposition from detention today in a conciliatory gesture designed to ease pressure on the approach of a potentially explosive Shiite Moslem holy day.

His move also was intended to speed the long-stalled formation of a civilian Cabinet to replace the floundering military government.

Karim Sanjabi and Darius Foruhar, followers of the late nationalist Prime Minister Mohammed Mossadegh who was overthrown in a CIA-aided coup in 1953, made no statement on their release from a house run by SAVAK, Iran's dreaded security police.

They had been arrest Nov. 11 at Sanjabi's luxurious north Tehran home in front of journalists to whom Sanjabi was about to read a hard-line opposition communique.

Reflecting on Sanjab's wvisit in France with Ayatollah Ruhollah Khomeini, the exiled Shiite Moslem leader dedicated to the shah's overthrow, that communique had condemned the shah's "illegal monarchial regime" and called for a referendum to permit Iranians to decide if Pahlavi rule should continue.

Veteran observers said Sanjabi's release was the outcome of feverish efforts by the shah and the often bickering opposition to find a political compromise that so far has eluded them in the nearly year-long political crisis.

The freezing of Sanjabi, 73, and his younger associate came only hours after an announcement that the shah had ordered for Saturday the release of a further 120 political prisoners and 352 other Iranians sentenced by military courts to mark international Human Rights Day.

Saturday is the eve of the two-day mourning period marking the anniversary of the death of Hossein, the founder of Shiite Islam. This year, Khomeini has turned the observance into total confrontation with the shah.

A three-day-old strike that Khomeini called among oil workers has reduced production from a normal 6 million barrels a day to 2.9 million barrels, with a further decrease predicted. Each million barrels of unsold oil represent the loss of about $12.5 million in foreign exchange.

The shah's gestures reflected fears of major voilence and bloodshed over the mourning period, which starts Saturday at dusk and ends 48 hours later. They also seemed designed to ease formation of a civilian government acceptable to the domestic political opposition.

Its principal task would be organize free elections within six months. Left unsaid was the assumption that in the process the shah would cease to run Iran as a one-man show and become a constitutional monarch who reigns but does not rule.

Opposition leaders who had been willing to settle for such a deal earlier increasingly have begun to demand that the shah abdicate in favor of his 18-year-old son, Crown Prince Reza.

The very formation of a civilian government would mark the first serious blow to Khomeini's increasing prestige and influence in Iran.

The 78-year-old religious leader has opposed any dealings with the shah or his family - or for, that matter any election under the constitution, which he wants scrapped to make way for a yet ill-defined Islamic republic.

Still unclear is whether the divided, but democratically, inclined domestic oppostiion would dare risk Khomeini's wrath by thus advertising its privately expressed differences with him. So far, there has been silence for fear of losing public support.

The dearth of prominent young opposition leaders reflects a total vacuum the shah has imposed on Iran for the past generation. Most opposition leaders are French-speaking members of the elite, many in their 70s and of comfortable means.

The opposition claims that students, religious leaders, bureaucrats, bazaar merchants and the working masses of Iran's swollend cities have united in one movement. But there remains a sizable gap between the septuagenarian leadership and a nationa whose median age is well below 20.

According to one opposition lawyer, the engineers and electricty company workers who almost nightly cut the power to given neighborhoods on a previously announced schedule are really signaling the shah they are part of a new technical elite that can run Iran without him.

Their ideas, often formed in American or Western European universities, reflect a desire for participatory democracy which neither Khomeini or even the lay opposition of the same generation has grasped fully.

Mindful of such differences, the shah is scheduled to receive an old political critic Thursday in yet another effort to stitch together a political solution. His visitor is Dr. Ali Amini, a former prime minister whom Iranians insist the liberal-minded Kennedy administration imposed-breifly-on a reluctant shah in the early 1960s.

The shah has once again over the past two months started receiving Amini after a five-year hiatus. This reflects less a change of heart than apparent desperation caused by the semingly endless round of street demonstrations and crippling strikes that have all but ended effective government here.

Amini is said to have found someone who is loyal to the shah and capable of heading a civilian Cabinet that might lead the country back to political stability. Insiders claim the still unidentified candidate is honest, respected and likely to disarm opposition criticism because of service with Mossadegh and the torture and imprisonment it cost him.

Possible choices are believed to be Dr. Ali Akhbar Siassi, a former tehran University chancellor, and Gholam Hussein Sadiri, Mossadegh's interior minister at the time of the CIA coup.

If indeed such a person does succeed in forming a viable civilian government, its first task will be to reverse the trend that discredits the shah's every move and accords total credibility to the opposition.

One drastic action favored by respected politicans is summary punishment for former ministers and businessman now under arrest on corruption charges.

"It's not civilized," the politican said, "but if we don't show the public we are serious in this way, we will have a revolution in the real sense of the word and we will all be shot."

Other leading opposition demands are that the shah prove his good will by lifting martial law, punishing police officials accused of excesses and granting all political prisoners a general amnesty rather than releasing them in small numbers as has been the case so far.

The more conservative domestic opposition leaders favor a step-by-step approach for fear brushque overthrow of the shah could set off violent upheavals with incalculable consequences. They are specially worried by possible splitting of the armed forces and massive departure of middle class talent. CAPTION: Picture, Karim Sanjabi . . . opposition leader