The United States and Japan reached an understanding yesterday that will permit United Airlines to replace Pan American World Airways on all its flights to Tokyo, airline industry and government sources said.

The State Department has scheduled a news conference today to announce an agreement, but sources said late yesterday there still is a slight chance of a "last-minute glitch," as one of them put it.

The understanding will permit United to take over Pan Am's flights to Japan as early as Feb. 11. Under existing treaties, the United States has the right to designate the U.S. airlines that will serve Japan, but the Japanese must grant landing rights. The Japanese had sought to tie the transfer of landing rights from Pan Am to United to other long-standing aviation disputes between the two countries.

The sources said there were no U.S. concessions to Japan. However, the United States will meet with Japan in the spring on the revision of the existing bilateral aviation agreement. Those talks probably will precede the May economic summit but follow a visit to the United States by Japanese Prime Minister Yasuhiro Nakasone.

The Japanese have said they will seek additional U.S. landing rights for the Japanese cargo carrier Nippon Cargo Airlines, which currently is restricted to six flights a week to the United States.

Flying Tiger Line Inc., a U.S. freight carrier that has essentially unrestricted access to Japan, has expressed concern that the price for United's admittance to Tokyo would be much greater freedom for NCA. Japan Air Lines, the state carrier, is already the leading passenger and cargo carrier across the Pacific.

The understanding comes after the unusual direct involvement in an international aviation matter by President Reagan, Secretary of State George P. Shultz and Treasury Secretary James A. Baker III, all of whom met with senior Japanese officials this week to press the U.S. position.

Last Monday, the third round of meetings between technical representatives of the two countries was concluded without resolution, forcing United to postpone its takeover, which had been scheduled for next Tuesday.

The next day, Baker met with Japanese Finance Minister Noboru Takeshita and raised the issue; Reagan mentioned it to Takeshita again on Wednesday. White House spokesman Larry Speakes reported that Reagan said, "This issue needs to be resolved."

United Chairman Richard J. Ferris was in Washington this week for a National United Way meeting and mentioned the matter to the president, who also attended the meeting, sources said.

United purchased Pan Am's Pacific routes, planes and employes for $715.5 million, but the deal is dependent on receiving the approvals of all governments involved.

Japan Air Lines has opposed the United takeover since it was announced last spring. United is the Western World's largest airline and has an enormous domestic route structure oriented to the West Coast, ideally situated to feed passengers to Pacific routes. Therefore, it will be a much stronger competitor for JAL than was Pan Am.

Thus, although U.S. officials maintained that they would not bargain for something they already have, they said they recognized a difficult domestic political situation for Japanese negotiators.

JAL this week issued a statement in Tokyo that said: "The unconditional entry of such a giant U.S. carrier as United Airlines to Japan would continue expansion of the existing imbalance in the U.S.-Japan civil aviation relationship to Japan's disadvantage. Some U.S. concessions are essential for the solution of this problem."

Illinois' two Democratic senators, Paul Simon and Alan Dixon, called on Reagan earlier this week to bar Japanese airliners from the United States until United's plans were approved. United is based in suburban Chicago.