Prime Minister Shimon Peres said today that the freeing of the remaining 39 American hostages from the hijacked TWA airliner in Beirut would remove "obstacles" to Israel's release of more than 700 Arab prisoners as demanded by the hijackers and their allies.

Speaking to reporters outside his home here this morning, when it appeared that the hostages would be freed within hours, Peres said Israel was not involved in "any deal" in connection with the crisis. But he and other Israeli officials strongly indicated that the release of most if not all of the detainees being held at Israel's Atlit Prison south of Haifa could be expected to follow the freeing of the American hostages.

This was apparently a central feature of what Israeli radio described as an "understanding" between the United States and Israel on how to bring an end to the 15-day hijacking drama.

But as the day wore on with reports of delays in the expected departure of the hostages from Beirut, it appeared that Israel might not be faced with an immediate decision regarding the prisoners it holds, most of them Lebanese Shiite Moslems. Sources here said yesterday that the Reagan administration has signaled its desire for Israel to continue to hold the Arab prisoners until after the American hostages had reached safety, and this clearly was Israel's intention.

The Israeli Cabinet holds its regular weekly meeting on Sunday. If the Americans are freed by then, a senior Israeli official said today, it is "very possible" that the Cabinet will authorize the release of most if not all of the prisoners at that time.

However, there continued to be considerable uncertainty surrounding the entire hijacking affair, including the timing of any future release of the prisoners from Atlit. Peres said today that the "obstacles" would be removed when the hostages "reach their homes," suggesting that there may be no concrete action here until the Americans are back in the United States.

Reports of the imminent departure of the hostages from Beirut sparked speculation that the Israeli Cabinet could be called into special session tonight, after the end of the Jewish Sabbath. But this apparently never was considered seriously. Israel and the United States are seeking to minimize the appearance of linkage between the hijacking and release of the prisoners, and an emergency Cabinet meeting would only be "a dramatization of the situation," one official said.

While Israeli officials insisted that they were involved in "no deals" in the hostage crisis, Peres' mention of the removal of "obstacles" was the strongest indication here of the unstated, but apparently clearly understood, role that Israel was expected to play in ending the hostages' ordeal.

"Obviously, if the hostages will reach their homes, we won't have the obstacles we have had until now to proceed with our own way of releasing the prisoners," the prime minister said. "I hope this agony will come to an end as soon as possible," Peres added. "Israel didn't have to make any deal or break any deal."

According to Defense Ministry sources, the apparent breakthrough in the hostage drama came when the hijackers and their allies from the Lebanese Shiite militia Amal backed down from a demand for the simultaneous release of the American hostages and the prisoners at Atlit.

The sources said this was the main reason that a proposal earlier this week by Nabih Berri, the Amal militia leader who has been negotiating for the hijackers, to have the hostages turned over to a western embassy in Beirut fell through. The French government explored playing the key role in such an arrangement but backed out when it could not gain assurances from the United States or Israel that the prisoners and the hostages would be released simultaneously, the sources said.

When this deal collapsed, according to the Israeli sources, Berri, apparently under pressure from Syria, dropped the simultaneous-release demand and agreed to settle for assurances that the prisoners would be freed.

"The main concession by the hijackers was that the release wouldn't come at the same time, but that release of the hostages would be followed by the release of the prisoners," one official said. "Apparently they were told by the Syrians this is the best they can do."

It was also during these delicate negotiations that the United States appears to have passed word to Israel that it was holding out for freedom for the hostages first and that Israel should sit tight on the prisoner question. Israeli officials have said from the beginning of the hijacking crisis that they would seek to help the United States but would decide on release of the prisoners only on the basis of the "security situation" in southern Lebanon.

Before the hijacking, Israel was on the verge of releasing about 350 of the Atlit prisoners. This fell through at the last minute, for reasons that never have been explained fully, but it appeared to give Israel leeway to free at least 350 prisoners almost immediately and still claim it was based on improved security conditions in southern Lebanon. In the two months preceding the hijacking there was a marked decline in the number of attacks against Israeli forces and their allies. It was because of these attacks -- 285 in March alone, according to the United Nations -- that Israel detained the more than 700 Arabs now at Atlit.