Egyptian President Anwar Sadat declared today that Egypt and Israel are "on the verge of an agreement," but informed sources said some of Sadat's top advisers are warning him that the proposed accord will cause Cairo severe problems in the Arab world.

The divisions within the Egyptian inner circle became known as presidents Carter and Sadat sought to resolve the few remaining differences before Carter flies to Israel on Saturday night to continue his dramatic peace effort.

Although Sadat said Israel and Egypt are close to agreement, it nevertheless still seemed far from certain here that Carter's mission will result in the accord he seeks. Carter and his aides took care to sound neither optimistic nor pessimistic.

Sadat's comment touched off an initial wave of optimism in the large international press corps that accompanied the two leaders to Alexandria. But it appeared that Sadat was emphasizing the point that he was willing to sign a treaty based on the new language he is proposing on the outstanding issues -- more or less the same public relations tack taken by Prime Minister Menachem Begin in Israel.

Sadat's advisers fear that the wording of the latest proposals will cause them to be viewed as a separate Egyptian-Israeli agreement, which is what other Arab nations and the Palestines have feared all along.

Well-informed sources said Sadat, who is committed to concluding a treaty, appeared willing to agree to the general basis of the proposals Carter handed Begin last weekend. But some of Sadat's top advisers, including Prime Minister Mustafa Khalil, were said to be holding out.

Khalil said tonight that differences of language remain on key points and that "language affects meaning." He said he still had a "job to do" in finding appropriate treaty language.

Khalil and Secretary of State Cyrus Vance met several times today seeking the acceptable language. Carter and Sadat also are scheduled for another round of talks Saturday -- in addition to Carter's address to the Egyptian parliament and a look at the pyramids -- before the U.S. president heads for Israel.

White House press secretary Jody Powell said tonight that "we have learned what the Egyptians can live with" and it is now the task of the Americans to reach a "meeting of the minds" in Israel.

Other American officials, it was learned, were discussing with Egyptian officials proposals for an increased U.S. naval presence in the Middle East as a way of demonstrating increased American commitment to the security of the region. This is a matter of heightened concern to Sadat, especially since the fall of the shah of Iran.

The Carter-Sadat talks moved today by rail from Cairo to this ancient Mediterranean port city. The shift was made at the urging of Sadat, who was eager to show his country to Carter and show off Carter to his country. Large and enthusiastic crowds greeted the two leaders as they traveled the 120 miles, just as they did when Sadat took Richard M. Nixon on the same trip in 1974 in the same open train car.

In an interview with American television networks, Sadat sounded his optimistic note. "I am ready to sign the agreement yes," he said. "I can speak for myself, not for the Israelis. For myself, I am ready.

"I think we are on the verge of an agreement," Sadat added. "In the very frank discussions we had last night, I found, really, that there are no obstacles in the way because there is only a misunderstanding... "

Asked about the main sticking points, he said: "I think, and it may appear... ridiculous, some words here or there, only some words here or there."

"I don't know whether we can sell the looser language to the rest of the Arabs," one of Sadat's top advisers said in an interview, suggesting that despite Sadat's assessment, Carter's latest proposal was still not entirely acceptable.

This adviser and others cautioned that differences still remain between the Egyptian and Israeli positions. The biggest, he said, is the "question of a target date" for achieving autonomy for Palestinians in the Israeli-occupied Gaza Strip and the West Bank of the Jordan River.

Egypt wants to hold to the position stated in a side letter to the draft treaty -- that negotiations for establishing election ground rules should begin one month after the treaty is signed, and that the elections themselves should be held within one year.

Under the Camp David agreements of last September, a five-year transition period to local self-government in the occupied territories only begins after these elections are held. The Egyptians, therefore, want to pinpoint the date for them.

But the Israelis say that if the actual holding of elections is part of the document, Palestinian terrorists could, by preventing elections from being held, thwart the treaty.

This has led Carter to offer a compromise, according to informed sources, in which negotiations setting up the elections would be completed within a year, but not the elections themselves.

Sadat's advisers also say that Egypt does not want to acced to Israel's insistence that an exchange of ambassadors take place right after Israeli troops withdraw from the Sinai. That would grant full Egyptian recognition to Israel before establishment of Palestinian self-rule.

Egypt wants to specify in the treaty only that diplomatic relations will be established. In this way, Egypt could point to the promise of an exchange of ambassadors as a lever for holding Israel to its commitments to autonomy for the Palestinians.

And, the Egyptian advisers maintain, Israel's reemphasized demand for guarantees on purchases of all oil produced by the Sinai wells it will turn back to Egypt is not even a matter that should be discussed now. Oil sales from the Sinai wells should be negotiated only after a treaty is signed and normal diplomatic relations have been established, Khalil said.

Sadat's advisers made it clear that they feared a hostile reaction from the Arab world if Sadat yields on these issues, especially the question of a target date for elections in the West Bank and Gaza.

"We should take the Arab threats seriously," said one of Sadat's closest advisers. "I believe that we will be isolated for a long period of time."

He said this could result in Arab economic sanctions against Egypt and even Egypt's ouster from the Arab League. Saudi Arabia also could slow delivery of its $1 billion-a-year economic aid to Egypt.

Carter told the American television correspondents: "I think things are going well. We have some problems obviously."

Carter said there were no surprises, either positive or negative, in his talks with Sadat.

"We obviously came on this trip without any assurances of success," Carter said.

Sadat was host tonight at a formal dinner for the Carter party at which American officials held to their guarded assessments of the negotiations. U.S. national security adviser Zbigniew Brzezinski, asked about their status, said, "The same."

Defense Secretary Harold Brown said he agreed with White House assistant Hamilton Jordan's assessment, which was "progress but problems." To that Brzezinski added, "Problems and obstacles."

Carter, in an exchange of toasts, said, "Some of the distrust, some of the difficulties of communication, some of the ancient animosities still exist."