U.S. District Court Judge Robert R. Merhige Jr. ruled yesterday that Eastern Airlines is guilty of "invidious sex discrimination" for requiring its stewardesses to take unpaid leaves as soon as they know they are pregnant.

Merhige imposed temporary maternity leave rules on the airline that will require it to permit cabin attendants to continue flying, in some instances, through the first 28 weeks of a pregnancy.He also ordered Eastern to pay back salaries to all stewardesses who have lost pay because of the maternity policy since Oct. 27, 1972.

Merhige's ruling marks the sixth time in recent years that U.S. District Courts have decided disputes between stewardesses and airlines over mandatory maternity leave rules, and the score is now tied with three rulings in favor of the air carriers and three in favor of the flight attendants.

In the only case that has gone through the appeal process, the 4th U.S. Circuit Court of Appeals upheld United Air Lines mandatory leave policy almost identical to Eastern's and the U.S. Supreme Court refused to consider the case.

Although Merhige is bound by 4th circuit decisions, he said in a 57-page memorandum yesterday that he does not consider the United case to be an obstacle to his ruling because of conflicts between evidence in two cases.

The United case, he noted, developed conflicting medical opinions on the effects of pregnancy on stewardesses while in the Eastern case, he said:

"It was the consensus view of . . . experts that pregnancy, in the vast majority of cases, is an entirely healthy condition that becomes disabling only near the commencement of labor."

Legal sources said yesterday that because the pregnancy rulings are turning on disagreements over facts - medical testimony - rather than law, it may eventually be settled by legislation or administrative regulations rather than a Supreme Court decision.

Merhige said he based his finding of sex discrimination by Eastern on evidence that the airline had never evaluated the effects of pregnancy on safety and job performance until it was sued and on evidence that Eastern has a history of sex discrimination, including former rules barring stewardesses who were married or had children.

"The court simply does not believe that Eastern's mandatory leave policy has its genesis in a concern for the safety of its passengers," he said, and he added later:

"Eastern's policy, in short, is the remnant of a historical pattern of discrimination based on antiquated assumptions about the role of women, family and employment."

In addition to granting pregnant flight attendants the right to continue flying, Merhige also ordered the airline to offer them ground jobs, when available, without loss of flying seniority and to reinstate them as long as three years after a medically disabling pregnancy.

However, Merhige ruled against stewardess demands that Eastern provide the same medical insurance and sick leave benefits for pregnancies that it does for illnesses and injuries. He cited recent Supreme Court decisions upholding the right of employers to differentiate between maternity benefits and other medical benefits.