John Anthony Walker Jr., accused of masterminding an espionage ring that funneled sensitive military secrets to the Soviets for as long as 20 years, and his Navy seaman son, Michael Lance Walker, have agreed to plead guilty to espionage and conspiracy charges, government sources said yesterday. Details of the plea agreements are expected to be revealed Monday in federal court in Baltimore.

John Walker, 48, a retired Navy chief warrant officer, has agreed to testify against his Navy buddy, Jerry Alfred Whitworth, 46, also charged with espionage, a government source said. The source also said John Walker has agreed to cooperate with the government in detailing the activities of what authorities have described as the largest and most damaging spy case in decades.

Jury selection was scheduled to start Monday in the trial of John Walker, a Norfolk private detective charged with five counts of espionage and conspiracy.

But Judge Alexander Harvey II announced yesterday morning that the trial had been postponed. The judge's law clerk said prosecutors and defense lawyers for John and Michael Walker will appear in court at 10 a.m. Monday for "proceedings" of an unspecified nature. The trial of Michael Walker, 22, was to take place after his father's.

A government source said John Walker agreed to cooperate in exchange for lenient treatment for his son, a seaman aboard the nuclear aircraft carrier USS Nimitz until his arrest in May. But, the source cautioned, Michael Walker "is going to get a fair penalty" that will reflect the gravity of the offenses charged against him.

The Justice Department has adopted a hard line in negotiating plea agreements in espionage cases. John Walker's brother, retired Navy Lt. Cmdr. Arthur James Walker, 51, was convicted Aug. 9 of seven counts of espionage after the Justice Department refused his offer to plead guilty to one count and no contest to the six others.

Father and son face maximum penalties of life imprisonment.

"As far as we are concerned, we intend to do everything within our power to see that John Walker is found guilty of all the serious crimes with which he is charged and to see that he pays the maximum penalty," Justice Department spokesman Patrick Korten said yesterday.

Lawyers for Whitworth, a retired senior chief radioman of Davis, Calif., man whose trial is scheduled to begin Jan. 13, said the government was prompted to reach its plea agreement with John Walker because its case against Whitworth is the weakest of the four, and prosecutors wanted John Walker's testimony against his longtime friend to buttress their largely circumstantial case.

John Walker's lawyer, Fred Warren Bennett, and Michael Walker's lawyer, Charles G. Bernstein, both refused to comment on the reports that their clients had agreed to plead guilty. Bennett said Harvey had agreed to postpone the trial after meetings with prosecutors and defense lawyers Thursday afternoon and yesterday morning.

Assistant U.S. Attorney Michael Schatzow, who is prosecuting father and son, declined comment yesterday.

Navy officials said last summer that the information allegedly passed to the Soviets by Walker may have compromised secret Navy codes, possibly reducing the U.S. lead in antisubmarine warfare. In a news conference at the time, Defense Secretary Caspar W. Weinberger assessed the damage as "a serious loss."

The disclosure of an espionage ring allegedly operating within the military for as long as 20 years prompted a Pentagon reassessment, still in progress, of its security procedures and triggered calls from Capitol Hill, the Reagan administration and others for the reinstitution of the death penalty for espionage and the increased use of polygraphs to pinpoint potential spies.

John Walker's lawyer said as recently as Wednesday that he expected to proceed with a jury trial in the case. "At this point, it is a trial to begin Monday," Bennett, the federal public defender for Maryland, said at that time.

But, Bennett conceded, "It's going to be a difficult case because it is a difficult charge."

Among the witnesses against John Walker were to be his older brother, who is awaiting sentencing Nov. 12; John Walker's ex-wife, Barbara Joy Crowley Walker, whose telephone call to the FBI's Cape Cod office last November launched the case; his daughter, Laura Walker Snyder, who told the FBI her father had tried to recruit her as a spy when she was an Army communications specialist in 1978 and 1979; and his former business partner, Laurie Robinson.

Robinson, who bought out Walker's share in Confidential Reports Inc., a Norfolk detective firm, after his arrest May 20, said she received a telephone call from the government yesterday afternoon telling her she did not need to be in court in Baltimore Monday.

"Obviously it doesn't seem there's anything he can do for himself, but maybe there's something he can do for his son" by agreeing to plead guilty, Robinson said.

Arthur Walker's lawyer, J. Brian Donnelly, said his client, who is being held without bond, had been scheduled to be transferred to Baltimore yesterday morning. "I have a feeling they called it off," Donnelly said yesterday afternoon.

The cornerstone of the government's case against John Walker was to be a grocery bag full of classified documents found May 19 near a rural roadside in Poolesville in western Montgomery County, where Walker had been seen earlier in the day.

Inside the bag, which was disguised as trash, were classified documents from the. Nimitz and "Dear Friend" letters from Walker to his Soviet contact, FBI agents testified at Arthur Walker's trial.

In addition, prosecutors were expected to introduce the contents of a manila envelope, dropped by Walker at the time of his arrest in a Rockville Ramada Inn early the next morning, providing detailed instructions about how to leave a package at the Poolesville site. Another expected piece of evidence, seized in an FBI search of Walker's home and labeled "The Vienna Procedure," outlined procedures for meeting with a Soviet contact outside the country.

Michael Walker admitted his involvement in the espionage scheme to investigators, an FBI agent has testified. According to court testimony, 15 pounds of classified documents were found stashed near his bunk on the Nimitz at the time of his arrest two days after his father was taken into custody.

Bennett, in an interview earlier this week, refused to disclose his planned strategy to combat that array of evidence. However, he said, referring to a decision by Arthur Walker's lawyers to rest their case without calling a single defense witness, "We intend on calling witnesses. We certainly intend to do more than they did down in Norfolk."

Because of the massive publicity generated by the Walker case, 300 people had been summoned for the pool of potential jurors to hear the case against John Walker, according to court clerk Gary Sapperstein. He said it was the largest jury pool in Baltimore federal court since the 200 prospective jurors called in the 1977 political corruption trial of Maryland Gov. Marvin Mandel.

To accommodate the large number of potential jurors, jury selection was moved from Harvey's regular courtroom to the ceremonial courtroom normally used for swearing-in ceremonies. The clerk's office issued press passes for the horde of reporters expected to cover the case, the first time credentials had been required since the Mandel trial.

At a news conference yesterday morning timed near the expected start of the Walker trial, Rep. Don Edwards (D-Calif.), chairman of a House Judiciary subcommittee on civil rights, and Rep. Pat Schroeder (D-Colo.) released a report concluding that the United States is "easy picking" for spies.

"Instead of political beliefs, we should focus on the greed, job dissatisfaction, and personal problems that seem to have motiviated most recent spies," the report said.