BEIRUT, Lebanon (AP) _ The spiritual guide of the pro-Iranian group Hezbollah today offered to help free Western hostages held in Lebanon if the West helps release Arab prisoners held in Israel.

''Let us get to an agreement together so that each side would use his own means and influence to end the crisis of the hostages, all hostages, and resolve the problem of Arab prisoners,'' said Sheik Mohammed Hussein Fadlallah during a sermon at Beirut's Bir el-Abed Mosque.

''I am ready to help free the Western hostages provided that Western countries help release Lebanese and Palestinian prisoners in Israel,'' he said.

Hezbollah is believed to be the umbrella for Shiite Moslem factions holding most of the 16 hostages in Lebanon.

Fadlallah did not mention any names, but his comments were similar to an offer made earlier this month by the Revolutionary Justice Organization, a pro-Iranian group that holds American hostage Joseph Cicippio.

It said it would free Cicippio if Israel freed Sheik Abdul Karim Obeid, a Shiite Moslem clergyman Israel kidnapped July 28, and 450 Arab prisoners. It also demanded that Israel allow 55 Palestinians deported in connection with the anti-Israeli uprising in the occupied territories to return home.

During his speech, Fadlallah also praised a bombing attack carried out by a Shiite Moslem cleric in retaliation for Israel's abduction of Obeid.

Five Israeli soldiers and an allied militiaman were injured Wednesday when a Shiite Moslem clergyman, Sheik Asaad Birro, detonated a truck bomb as an Israeli military patrol passed in southern Lebanon. Birro was killed.

''Sheik Asaad Birro has, by his attack, knocked down the theory of a security zone,'' Fadlallah said, referring to the 6- to 10-mile-wide strip of land Israel carved out in south Lebanon to protect itself from guerrilla raids.

Hezbollah also released a videotape made of Birro before the attack.

In it, Birro said, ''My operation is a gift for the nation of Hezbollah... and the heroes of the uprising against the cancerous nation (Israel).''

''I hope it will be a modest step toward the elimination of the Zionist entity,'' he added. Birro appeared nervous, stumbling on some words as he tensely clutched a prepared text.

In Israel today, Prime Minister Yitzhak Shamir told U.S. congressmen he is optimistic Israel can negotiate the release of missing Israeli soldiers and American hostages in Lebanon.

Rep. John Hiler told reporters after the hour-long meeting that Shamir said ''he was hopeful what was taking place would lead to the release'' of the captives.

The Indiana Republican attended the session with Rep. Robert Clement, a Democrat from Tennessee, and Rep. William Emerson, a Republican from Missouri. They are touring Israel as guests of the Anti-Defamation League of the B'nai B'rith.

Hiler quoted Shamir as saying ''there were ongoing negotiations,'' but he gave no specifics. Officials have said contacts with Shiite Moslems have been made but no negotiations were under way.

The foreign hostages include eight Americans. The hostage held longest is Terry Anderson, chief Middle East correspondent for The Associated Press. He was kidnapped March 16, 1985.

On July 31, a pro-Iranian group claimed it killed one hostage, U.S. Marine Lt. Col. William R. Higgins, in retaliation for Israel's refusal to free Obeid.

Israel said it kidnapped Obeid to swap him for three Israeli soldiers held in south Lebanon and the Western hostages.

Fadlallah made his comments in a sermon marking the anniversary of the death of Shiite Moslems' most revered saint, Imam Hussein bin Ali, grandson of the prophet Mohammed.

He was killed in 680 B.C. by Sunni Moslem armies after a 10-day siege in Karbala, in what is now Iraq.