Last ditch efforts by Iranian officials and foreign mediators to salvage a hostage transfer plan collapsed today as Ayatollah Ruhollah Khomeini declared that the American captives must remain in the hands of their militant student captors until Iran's future parliament decides their fate.

The ayatollah's statement preceded Washington's announcement of economic and political sanctions against Iran, an action that drew no immediate response from the Iranian government.

[The ruling Revolutionary Council met in special session early Tuesday morning to discuss the U.S. sanctions, and President Abol Hassan Bani-Sadr postponed a trip to the oil-producing parts of Khuzestan province to deal with the developments. Council members said after the meeting that no decision was reached on how to respond, and Bani-Sadr, was scheduled to meet with Khomeini later Tuesday.]

A spokesman for the militants occupying the U.S. Embassy said, however, that "these actions and pressures will not have any effect on our will, but they'll only strengthen our determination and not influence the path that we are following."

Observers here also doubted the sanctions would bring much pressure on Iran, since most U.S.-Iranian trade has already been cut and diplomatic relations between the two countries have been almost nonexistent.

Meanwhile, three American clergymen who held Easter services for the hostages Sunday reported that they had seen 31 of them, and not all 50 as they had originally believed. They said they arrived at the figure today after comparing notes of their conversations with the captives.

The U.S. clerics said they did not know whether four other clergymen who were present saw other hostages.

The American ministers also said they had been blindfolded when the captors took them into the embassy compound. They repeated their insistence that the hostages they saw appeared to be in good condition, but one cleric expressed uneasiness about "unanswered questions" on the Americans' captivity.

Hope that a plan to transfer the hostages from the militants to the control of the ruling Revolutionary Council was dashed when Khomeini, in his first public statement on the issue, said:

"The hostages in the embassy will remain in the hands of the Moslem and militant students until the formation of the Islamic parliament and the determination of their fate by the respected deputies of the nation. We have pointed out many times that the condition of the hostages and their place is good from every point of view."

Khomeini previously had declared that the parliament would decide the hostages' fate, but had not specifically ruled out their transfer to government control in the meantime.

The statement, issued by Khomeini's office in the holy city of Qom and broadcast by the state radio at 2 p.m., followed a midday visit to Khomeini at his temporary home in Tehran by Bani-Sadr and three other members of the Revolutionary Council.

The council emerged divided late last night from a meeting on how to respond to recent messages from President Carter and whether to go through with a transfer plan that had been approved by the council the week before. Unable to reach a unanimous decision, the council decided to refer the matter to Khomeini and named a four-man delegation to seek his decision.

The delegation also discussed with Khomeini Iran's current crisis with neighboring Iraq, the state radio said.

The failure of the hostage transfer plan marked a sharp setback for Bani-Sadr and his secular government supporters, especially Foreign Minister Sadegh Ghotbzadeh, who acted as the plan's strongest proponent.

Despite the collapse of the transfer effort, an ad hoc commission of five non-Iranian intermediaries in the U.S.-Iran crisis continued tonight to seek common grounds between the two countries. A late night meeting with Bani-Sadr evidently produced no results, but Ghotbzadeh reportedly asked the commission to stay in Iran for another 48 hours.

"Sanctions or no sanctions, we will keep trying to find points of compromise, areas of good will," one member of the self-appointed commission said. "We will keep the door open."

Another member said the intermediaries were "trying to do something to restore Iran's international standing" following the collapse of the transfer plan.

The U.S. imposition of sanctions appeared to complicate the intermediaries' efforts and strengthen the hand of the clerical hard-liners who oppose Bani-Sadr and Ghotbzadeh.

In an interview today, the three U.S. clergymen who visited the occupied embassy Sunday said the the hostages they saw appeared well treated.

The Rev. Jack Bremer, the leader of the group representing the Kansas-based Committee for American-Iranian Crisis Resolution, said, "I got no indications of physical abuse or any pyschological pressure other than the confinement itself."

He quoted embassy press attache Barry Rosen as saying, "They started out treating us like prisoners of war, but gradually came to see us as human beings and treat us as human beings."

Bremer said Rosen told him that physical problems described to an Iranian doctor last month had cleared up and that he was in good shape.

The Rev. Nelson Thompson agreed that he saw no evidence of mistreatment among the hostages he visited separately, but added, "some of the things that happened leave some questions in my mind."

He said that two Iranian priests who also visited the embassy disappeared after the Easter services. "We didn't see them again," Thompson said. "That bothered me."

Thompson added that four or five of the 20 hostages he saw personally told him that "It's not all that it appears." He added, "They really let me know they couldn't discuss it."

While stressing that most of the hostages' comments were "positive" and made without intimidation, Thompson was visibly upset when he recalled parts of his visit.

"It was tragic," he said. "I had tears in my eyes. Some of those kids are so young."

The clergymen said they saw none of the hostages whom the militants have accused of espionage or being disruptive and who are believed to be held in solitary confinement in an embassy basement.

These hostages include Thomas Adhern, William Daugherty, Malcolm Kalp and Michael Metrinko. Thompson said a few of the hostages they saw expressed despair that they would ever be released.

Breer said the "mail from home is a crucial morale thing" and that some hostages claimed that deliveries had slowed down and wondered whether U.S. or Iranian authorities were responsible. Others said they received letters twice a week.

The Rev. Darrel I. Urpiper, the clergyman most sympathetic to the captors, said when the subject of blindfolds came up that "the blindfolds were put on us for security reasons and we shouldn't betray the trust of the students.

The clergymen were blindfolded as they were being led from the embassy's rear entrance to the site of the Easter services inside an embassy building.

The clergymen also said that the students prohibited them from answering hostages' questions that were deemed political.

One hostage was interrupted when he asked a question of Thompson on how the U.S. presidential primaries were going and whether the hostage issue had anything to do with them. The guard said he would gather the information and that the militants would respond to such questions themselves.

(In another development, American hostage Michael Moeller denied having sexual relations with a 23-year-old Iranian female student who later was hanged by her brother, the Associated Press quoted the Tehran newspaper Kayhan as saying Monday.

The newspaper said an Iranian Justice Ministry investigator, Ali Akbar Parvaneh, questioned Moeller at the U.S. Embassy. The hostage said he met the girl, identified only as Azam A., in October before the embassy takeover, but denied he had sexual relations with her, the newspaper said.

[Moeller has been identified in American news reports as a U.S. Marine sergeant from Loup City, Neb.]