The Israeli invasion of Lebanon and siege of West Beirut have seriously undermined Egypt's policy of peace with Israel and hopes for a rapprochement with the rest of the Arab world, Western diplomats here say.

They also believe that if the Lebanese crisis does not lead to hope for a settlement of the larger Palestinian question, the consequences for the young and still vulnerable government of President Hosni Mubarak could be dire.

In a bid to protect himself from the popular outrage at Israel, Mubarak has allowed the state-controlled press to make vitriolic attacks on Israel and has himself denounced the Israeli invasion as "treacherous." He has also frozen the process of normalizing Egypt's relations with Israel and has promised not to resume negotiations over the Palestinian autonomy issue until Israel withdraws from Lebanon.

At the same time, he has dexterously turned Egypt into a foremost defender of the Palestine Liberation Organization and its cause, despite Cairo's diplomatic isolation in the Arab world because of its peace treaty with Israel.

But diplomatic observers here do not seem to believe that Mubarak, for all his lobbying efforts in Washington and at the United Nations, has achieved much for either Egypt or the PLO. They also warn that his 10-month-old government still faces a potential avalanche of criticism, both inside and outside Egypt, if Israel finally invades West Beirut and crushes the Palestinian guerrillas trapped there.

The biggest test of Egyptian diplomacy is now under way in the U.N. Security Council, where France and Egypt have introduced a resolution that would link a resolution of the impasse over the Palestinian withdrawal from Beirut to an overall Middle East settlement.

Its adoption would assure Egypt of a central role in future Middle East peace diplomacy and probably end its isolation in the Arab world. But the United States, its closest superpower ally, is reported to be against making such a formal linkage.

Thus, prospects for passage of the resolution seem dim, barring some unexpected change in the U.S. or Israeli position on the Lebanese crisis.

The Israeli invasion of Lebanon has caused bitterness toward the United States as well as Israel and has made Egyptians question the value of the peace treaty with the Jewish state and Cairo's alliance with Washington.

"There is not an Egyptian in the streets who doesn't believe the United States gave the green light to Israel to invade Lebanon," a high-ranking Egyptian official told a visiting congressional delegation earlier this week.

But the focus of Egyptian fury has been on Israel, its would-be peace partner that continues to put Egypt in impossible situations with its strikes against other Arab states and its actions in occupied Arab territory.

"All Arabs feel a sense of humiliation," remarked one diplomat, referring to Israel's invasion of Lebanon. "But the Egyptians in particular [feel it] as partners in the Camp David process."

"There is a feeling among Egyptians of being 'had' and 'used' by Israel as a result of the Camp David accords," one diplomat said.

Those American-brokered agreements led in March 1979 to Egypt's becoming the first Arab nation to sign a peace treaty with Israel.

The upsurge in popular discontent with the accords, shared by much of officialdom, is a problem for Mubarak, who has made continuing adherence to the peace treaty and the alliance with the United States the central planks of his foreign policy.

With no domestic achievements to boast of and the economy in a morass of problems, Mubarak can hardly afford a major humiliation in his foreign policy. He is still trying to prove his leadership following the assassination of president Anwar Sadat last October.

Some Western diplomats believe it is possible that Mubarak will progressively lose credibility with the armed forces and the public and be shunted aside in a bloodless coup by the Army. Some say this could occur before the end of this year if the Lebanese crisis drags on and Israel acts to crush the PLO.

This may help explain what one diplomat called the "frenzied diplomatic activity" of the Egyptians on behalf of the PLO and its cause.

"They are really vulnerable as long as the Palestinian issue is not addressed," he remarked.

The Egyptian leader has sent half a dozen messages to President Reagan since the invasion began June 6 and has also sent his foreign minister, Kamal Hassan Ali, to Washington twice. He is now there with another message for Reagan and talks with Secretary of State George P. Shultz.

The Egyptian position dates back to Sadat's policy of trying to get the United States and Israel to recognize the PLO and negotiate with it.

While there has been no breakthrough on this front, one concrete result of the Lebanese crisis has been improvement in Egypt's relations with the PLO. In fact, Palestinian officials here and in Beirut acknowledge that Egypt and Saudi Arabia have been their most helpful Arab allies, particularly in dealing with Washington.

Western diplomats here are puzzled that Egypt has lobbied Washington a lot harder than it has the PLO, whose unequivocal recognition of Israel would seem to be one certain key to opening the door to new developments in the peace process.

In dealing with Washington, Egypt's attitude has been similar to that of other Arab allies of the United States who insist that there be some linkage between the narrow issue of the Palestinian evacuation of Beirut and the broad Palestinian question.

Mubarak rejected the attempt by special U.S. negotiator Philip Habib to get Egypt to take all the 5,000 to 6,000 Palestinian guerrillas bottled up in West Beirut, primarily because the American diplomat offered no linkage, according to Egyptian sources.

A Western diplomat here suggested another reason for Egypt's refusal. "The reason they don't want to take" the Palestinians is that "it would make them look even more like accomplices of Israel and the United States in trying to solve the Beirut problem," he said.

There is a certain irony in the fact that Egypt has directed most of its diplomatic efforts at Washington rather than at Tel Aviv.

The Egyptian rationale for keeping its ties with Israel intact throughout this crisis is that its access there gives it a unique opportunity to act as go-between for the Jewish state and the Arab world.

Despite its freezing of the autonomy talks, Cairo has not withdrawn its ambassador from Tel Aviv in protest over the Israeli invasion.

In fact, there is no indication that Egypt has had any influence whatsoever with the government of Prime Minister Menachem Begin or has done anything more than pass a couple of PLO messages on to it early in the crisis.

Instead, Mubarak has directed most of his energies toward trying to persuade President Reagan to put more preassure on Israel to be flexible. Apparently his unique access to the Israeli government, secured at enormous cost to Egypt's position in the Arab world, has not benefited this nation much in the current crisis.

Meanwhile, except for a noticeable warming in its relations with Jordan, Iraq and Morocco, there have been no breakthroughs in Cairo's efforts to get back into the Arab community.

Egypt seems almost as distant and isolated from Israel as it does from the majority of Arab states.