The Carter administration, shaken by the failure of the latest attempt to free the American hostages in Tehran, clung to hope yesterday that the power struggle in Iran eventually will be won by moderates seeking to end the four-month crisis.

In the wake of the United Nations commission's failure to break the impasse over the hostages, U.S. officials would say only that President Carter will not make any decision about what to do next until Secretary of State Cyrus R. Vance meets with comission members in New York today.

Beyond that, the officials refused to concede that the commission refused to concede that the commission initiative and other peaceful options have been exhausted. Instead, they retreated behind a wistful-sounding rhetorical line laid down by the administration's top spokesmen.

Vance, after a meeting at the Capitol with congressional leaders, stressed to reporters that the commission's work is not finished. He said: "I am disappointed that we have had this setback, but I hope the suspension can be merely a suspension and we will find a way to move forward again."

"It is not our belief that it is time to write this effort off entirely," White House press secretary Jody Powell said. State Department spokesman Hodding Carter said: "This government believes that the situation requires first watchful waiting."

In private, U.S. sources said that, under current circumstances, there is nothing else the administration can do. The United States, they admitted, has no new strategy that can be brought into play effectively; the president has little option other than to be patient and hope that Iran's volatile internal politics will calm down sufficiently for moderate forces to gain the upper hand over the hostages' militant captors.

That, the sources conceded, could mean another lengthy delay in efforts to free the hostages, who have been held in the U.S. Embassy compound in Tehran since Nov. 4. In fact, the sources warned, it could take until May -- when an Iranian parliament has been elected and is in place -- before meaningful negotiations over the hostages' fate can be resumed.

Specifically, the sources said, the best hope is that the parliamentary elections, which begin Friday, will produce a majority responsive to the leadership of President Abol Hassan Bani-Sadr, a moderate on the hostage issue and the main force behind Iran's original agreement to receive the U.N. commission.

The two-pronged aim of the commission was to hear Iran's grievances and to resolve the U.S.-Iran crisis by facilitating the release of the hostages. t

While officials were reticent to spell out the terms while negotiations with Iran continued, reporters were told there was a clear agreement on all sides that release of the hostages was part of the "package deal" involving the U.N. commission.

U.S. officials described the internationally negotiated arrangement as a series of "reciprocal steps," requiring interlocking actions and commitments leading to the final result. One of the agreed steps, according to U.N. officials, was to have been the transfer of control of the hostages from the militants to the Revolutionary Council.

However, Bani-Sadr and other moderates within the Revolutionary Council suffered a humiliating rebuff when the militants, mobilizing support from both extreme right-wing clerical forces and extreme leftists, resisted efforts to pressure them into turning the hostages over to the council.

The resulting ferment that broke out in Tehran over the weekend caused Iran's most powerful figure, Ayatollah Ruhollah Khomeini, to come down on the side of the militants. He publicly backed their refusal to let the commission see all the captives, thereby undercutting the Revolutionary Council's authority and forcing the U.N. commission to break off its mission.

U.S. sources dealing with the crisis said they could not gauge whether Khomeini was arbitrarily demonstrating his power over Bani-Sadr and the council or whether he feared that their confrontation with the militants was leading to civil war and wanted to avert a showdown for the time being.

But, the sources added, the net effect was to underscore, as a senior U.S. official said Monday night, that "a serious question has arisen about the ability of the Iranian government to function as a government and to fulfill commitments that it makes."

Given that situation, the sources continued, Washington's best hope now is that the parliamentary elections will produce a moderate-leaning majority sufficient to strengthen Bani-Sadr's hand in arguing to Khomeini that majority sentiment within Iran supports Bani-Sadr's goal of ending the confrontation with the United States.

U.S. officials, recalling Bani-Sadr's landslide presidential victory in January, are cautiously optimistic that he can carry the parliamentary elections too. But the process will take time, and the Carter administration is admittedly nervous about whether American public opinion can be restrained from demands for drastic action in the interim.

In the administrative's view, a sudden return to get-tough tactics would play into the hands of Iranian extremists of the right and the left, who want to continue the crisis, and would give them the advantage in the parliamentary balloting.

For that reason, administration spokesmen were careful to state yesterday that military moves such as a naval blockage of Iranian ports are not being considered at this time. The aides even refused to say whether the president will mount a new campaign to enlist international support for economic pressures on Iran.

The sources conceded that some toughening of the U.S. stance toward Iran appeared inevitable in order to ward off charges from Carter's political opponents that his handling of the crisis is weak and vacillating.

So far, administration officials said, the reaction from Congress has been very restrained. However, California's two senators yesterday called for strong action against Iran.

Alan Cranston, the assistant Senate Democratic leader, said the United States should break relations with Iran and expel or intern Iranian diplomats. Republican Sen. S. I. Hayakawa went further and called for confining all Iranian nationals in this country in internment camps.

Hayakawa's idea came as a surprise. He is a Japanese-American, and his proposal was reminiscent of the relocation camps to which Japanese-Americans from the West were confined during World War II. Hayakawa, who was living in Chicago at the time, was not interned.

The sources said the president's mostlikely course, if public opinion seems disposed to let him follow it, will be to avoid, to the maximum degree possible, actions that could increase anti-American sentiment in Iran, and to hope that the balance of power there gradually shifts toward the moderates.