Prime Minister Menachem Begin of Israel and President Anwar Sadat of Egypt today underlined the gap still remaining between them as they were awarded the Nobel Peace Prize at a ceremony held in an isolated and heavily guarded medieval castle.

Although both leaders expressed hope that a deal would be reached, neither gave any hint of a readiness to break their deadlock over a Middle East peace treaty.

Begin, who came in person to receive his share of the award, stressed his support for a draft treaty that Sadat wants to amend.

Sadat, who pointedly passed up the trip and sent a lower-ranking Egyptian official to collect his medal, placed his emphasis on the rights of Palestinians.

Neither side had been expected to make concessions however, as Secretay of State Cyrus Vance began his trip to Cairo and Jerusalem in an effort to end the difference between them on the treaty.

The speeches at Akershus Castle on a fjord outside the center of Oslo struck a curious note at a rite honoring the Isracli and Egyptian leaders for their contribution to peace.

So, too, did the scores of soldiers, police and security agents armed with rifles and machine guns stationed around the castle's ramparts, courtyards and drafty halls.

Many Norwegians regard the award as another oddity in the eccentric history of the prize provided by the will of Alfred Nobel, inventor of fynamite and the percussion blasting cap. There is some support here for honoring Sadat, who 13 months ago made the dramatic gesture of traveling to Jerusalem to offer negotiations and recognition to Israel. But polls, formal and informal, disclose dismay over Begin's share of the prize.

Arbeiderbladet, the fuling Labor Party's daily, has criticized the decision editorially on Saturday. Dagbladet, a liberal daily ran a sneering cartoon of Begin that referred derisively to Israeli insistence on the right to establish new settlements in occupied territories.

In private, Foreign Office officials here regard the affair as inappropriate.A Norwegian professor who nominates peace prize candidates said he thought the winners had iittle in common with one of last year's medalists, Amnesty International.

Sadat spoke through his special representative, Sayed Marel. Marei told the carefully screened audience of 180 persons that Sadat's preoccupation with the continuing negotiations had kept him in Cairo.

In private, Egyptian officials have other explanations. They said they feared that false expectations of a quick settlement would be raised if both leaders appeared together in Oslo. Cairo wants the remaining an thorny problems bargained out at a level below heads of government.

Accepting the award for Sadat, Marei preceded his president's prepared statement with a warning that "dangers... difficulties... inumerable obstacles" still block the road to a "comprehensive" peace.

Despite the differences, both Begin and Marei observed all the courtesies. Before the ceremony, they spoke and smiled. They smiled and shook hands again after they received their medals and again after each of their speeches.

Aides to both are making it clear in private the there is little hope a deal can be reached by Dec. 17, the date forecast after the Camp David talks in September. But both camps also expressed their conviction that the differences will somehow be reconciled. As a key Israeli put it, "We have passed the point of no return from the path to peace."

Oslo's radical young men and women evidently agree. Dispirited groups of them gathered around the Grand Hotel, where Marei is staying; in front of Oslo University and in the town's central market. There, in the freezing cold they changed slogans denouncing Begin and Camp David and cheering the Palestine Liberation Organization.

The demonstrations, scrupulously announced by the Norwegian government in the press kit given correspondents, drew a few thousand in all.

Both Sadat and Begin agreed firmly on the point, that President Carter had played a crucial role in bringing them closer together. Sadat's message spoke of Carter's "signal efforts to overcome obstacles in the way of peace [which] deserve our keenest appreciation."

Begin spoke of Carter's "unsparing effort, untiring energy and great devotion in the peacemaking process" at Camp David.

At times, however, the Israeli leader almost verged on the belligerent. He began by saying he came from "the land of Zion and Jerusalem." This last is another sore point since all Arab states want some control over East Jerusalem, which Israel captured in the 1967 war.

Begin also used his peace prize address to praise armed struggle "for a cause" as the "highest human command." In the 1940s, he commanded Irgun, a terrorist force fighting to free Israel from British control.

Finally, he made a pointed reference to Jews unable to leave the Soviet Union before switching from English to Hebrew and quoting the climax to the Passover celebration, "Next year in Jerusalem."

Unlike the awards for literature and science which are granted by academies in Sweden, Nobel's will provides that the peace prize is determined by a committee selected by the Norwegian parliament. Its chairwoman, Aase Lionaes, is thought to be the key to this year's selection.

A strong-willed former legislator, Lionaes, 71, is said to dominate the committee and she is passionately proIsrael. So, according to those watch these matters closely here, Lionaes made it clear that if Sadat was to get the prize he would have to share it with Begin.

In her long introduction, she defended another of her controversial choices, the half prize won by Henry Kissinger in 1973. Kissinger, she said, launched the peace initiative in the Middle East; Sadat, she continued, held out his hand with his Jerusalem trip and Begin accepted it.

Besides medals and diplomas, the two leaders will share 725,000 Norwegian crown,s about $145,000.