If the last 39 Trans World Airlines passengers and crew from Flight 847 are released from their captivity in Beirut, seven American hostages kidnaped over the last 15 months will apparently still be left in the hands of extremist Shiites there, with no immediate prospect of their being freed.

Despite attempts by U.S. officials to link their release to that of the TWA hostages, the group, or groups, holding the original seven have refused to give them up. The Reagan administration was apparently prepared today to accept the 39 persons from Flight 847 without those other seven.

The history of attempts to gain their freedom underscores the difficulty that the mainstream Amal organization under Nabih Berri and Syria have had in dealing with these hard-core Shiite fanatics who are the most closely associated of all Lebanon's Shiite groups with Iran.

They have splintered into a multitude of grouplets acting loosely under the name of Hezbollah, the Party of God, and identifying themselves as Islamic Jihad or Holy War.

Starting almost a year ago now, the United States asked various Arab intermediaries, most notably Algeria and Syria, to contact the Americans' captors to see what could be done to gain the release of the first two kidnaped off the streets of Beirut.

To date, nothing has come of those prolonged efforts, and five others have been kidnaped in the meantime.

The seven Americans are reportedly held by several different groups which have quarreled among themselves over the terms for their release.

The captors' main demand, and apparently the main reason for six of the seven original kidnapings, has been the release of 17 terrorists, mostly Shiites, who were tried and convicted for a spate of bombings in Kuwait in December 1984.

At one point, the Arab intermediaries involved in the negotiations tried to persuade the Shiite groups holding at least six of the seven Americans to free them in return for a pledge that their 17 colleagues in Kuwait would be subsequently freed. But they refused this offer of a staggered swap.

As in the present hostage crisis, several of the Shiite extremists holding the Americans are said to have relatives among the 17 convicted terrorists in Kuwait.

The first two Americans to be kidnaped, literally off the streets of Beirut, were William Buckley, 58, a political officer at the U.S. Embassy abducted March 18, 1984, and the Rev. Benjamin Weir, 61, a Presbyterian minister there, kidnaped May 8.

The third American, Peter Kilburn, 60, a librarian at the American University in Beirut, was taken Dec. 3 last year. No group has ever claimed responsibility for that kidnaping, and there are fears about his fate because he suffers from a serious heart condition. The fourth American, the Rev. Martin Lawrence Jenco, 50, who is head of Catholic Relief Services in Lebanon, was abducted Jan. 8.

The other three are Terry A. Anderson, 37, chief of the Associated Press bureau in Beirut, taken March 16; David Jacobsen, 54, administrator of the American University Hospital in Beirut, kidnaped May 28, and Thomas Sutherland, 54, dean of the agriculture department at the American University, abducted June 9.

According to an unconfirmed report, one of the seven may have been taken to Tehran. This report is believed to have sparked the administration's warning to Iran early this year, repeated again in March, that the United States will retaliate against targets inside Iran if any of the American hostages are put on trial or executed.