The Metro transit authority and seven Washington area cities and counties must repay tiny Fairfax City the $2 million it has contributed to the regional subway, a federal judge ruled yesterday, because the station closest to Fairfax was removed from the system.

If yesterday's decision by Judge Oren R. Lewis stands, Fairfax City will be the first Metro partner to pull out of the rail system and get its money back.

The ruling comes as Metro is undergoing serious financial re-examination and large cracks are appearing in the facade of the regional unity in which the subway was born.

The award of the money "will be an undersirable precedent," Metro associate counsel John A. Robertie Jr. said, because it is based on a finding that the seven other Metro partners breached their agreement with Fairfax City. No decision on whether to appeal can be made until the ruling is discussed by the Metro Board, Robertie said. Most attorneys familiar with the case expect an appeal.

The central issue in the ruling is the long-planned but unbuilt subway station that would be closest to Fairfax City if the 100-mile rail system is completed. That station would be in Vienna at Nutley Road and Interstate Rte. 66.

However, a subsequent "interim" plan agreed to by all Metro members other than Fairfax city provides for construction of the Vienna line only as far as Glebe Road in Arlington nine miles closer to downtown Washington.

When Fairfax City sued, it said it wanted its money back or the Vienna station built - that station was the only reason Fairfax City had contributed any construction money to Metrorail since the rails were never scheduled to enter airfax City proper.

Judge Lewis found that the original Metro financing agreements had been breachedwhen the seven other members, facing rising costs and running out of money, agreed to the interim plan. Under that plan, 60 miles of subway will be built.

Most of the rest of the 100-mile system, including the line to Vienna, is being restudied by a regional task force with an eye to determining whether alternative means of transit might be substituted.

Judge Lewis' ruling, if upheld, will not interfere with that process. The other seven members of Metro - Fairfax, Arlington. Prince George's and Montgomery counties, the District of Columbia and the cities of Alexandria and Falls Church - would be free to continue planning whatever system they wanted after they bought out Fairfax City.

Lawyers said the decision does not set a precedent that would permit other area jurisdictions to withdraw from Metro and get their money back because the Fairfax City issue is a very narrow one concerning breach of contract.

Nonetheless, the Metro board has insisted that it has never abandoned the Vienna station or any other part of the original 100-mile system. It simply ran out of money and was pausing to regroup. Further complicating the Vienna route was the long-running controversy over whether to build I-66 inside the Beltway with the subway line down the middle. That issue too is still in the courts.

Judge Lewis was not impressed. "The defendants have refused to officially state what, if anything, they intend to do to assure the completion" of the Vienna route, he wrote.

Metro attorneys argued that since no further money was being sought from Fairfax City, it was not necessary to consult fully with the city when the interim agreement was reached.

"The defendants have not only reduced the facilities serving the city." Judge Lewis wrote, "they have terminated the only route designed to serve the city . . . This considerably lessened the benefits the residents of the city had a right to expect."

He ordered Fairfax City's original contribution to the subway repaid. Eight per cent interest on the $1,990,859,92 would be paid only from Dec. 2, the date that the Metro board approved the interim, 60-mile" system. He did not award Fairfax City interest on its $2 million from the date of contribution to the date of breach of agreement as Fairfax City had asked.

Fairfax had also asked for relief from all other losses it might sustain from the operating of the subway or the debt service on the bonds sold to build it. Lewis ruled that request premature, since no claims have been made.

Fairfax City Mayor Nathaniel F. Young said. "We're very happy, very elated. Basically, this is what we asked for." The loss of $2 million he spent $2 million on junkets to Russia and every other place that has a hole in the ground so I don't think it's going to be harmful . . . If (Metro) had come out to talk to us, we would have tried to find a way out of the woods."

Metro board vice chairman Joseph S. Wholey, who is also chairman of the Arlington County Board, said that Lewis' ruling "does not seem reasonable under the circumstances" and that he presumed there would be an appeal.

As chairman of the Metro board's revenue committee. Wholey said he was working on a plan to keep Fairfax City within the Metro fold.