Montgomery County Executive James P. Gleason's fight with the federal government over approval for a subway line is beginning to cost him allies, particularly in Virginia.

Gleason is withholding the $1.7 million county subsidy to operate the Metro bus and subway system and has refused to endorse a $328 million federal Metro subway construction grant until he gets a firm commitment from Transportation Secretary Brock Adams to extend the Silver Spring subway line through Wheaton to Glemont.

But that $328 million includes money for stations and other projects on the extension of the line from National Airport through Alexandria to Huntington in Fairfax County.

Because Gleason has not given his endorsement, Metro last week deferred the opening of bids for construction of the King Street station in the heart of Alexandria - a key link Huntington line.

"The Montgomery County situation is of serious concern to Virginia," Alexandria Mayor Frank Mann told the Metro board yesterday after reminding it that "this board stood firmly behind Montgomery County" in the past.

And Fairfax County Supervisor Joseph Alexander said he did not think it "proper" that Virginia construction should be held up by Montgomery County.

Roy T. Dodge, Metro's assistant general manager for construction and design, said that the $328 million had to start flowing within two weeks or several projects - in Virginia, the District and Maryland - would be delayed. Delays, because of inflation and other factors, have already cost Metro millions of dollars.

As far as operating the present bus and rail system is concerned, Metro assistant general manager for finance William A. Boleyn said that the system would run out of cash around Sept. 1 without the Montgomery County contribution.

"At that point," Boleyn said, "we have three choices: other jurisdisctions can advance operating money, we can borrow, or we can stop operations."

"We're not going to borrow," said Alexander.

Gleason told a reporter last week that he is taking the actions against Metro because it is not able to live up to a contract to build the Glenmont line.

The Transportation Department, under instructions from Congress, has ordered an engineering analysis of alternative means of construction. But it has refused to promise that it will build the line after that analysis is completed.

There is a firm belief in several corners of the Department of Transportation that new construction techniques and a different alignment can reduce the cost of the Glenmont line by as much as 30 per cent. It is variously projected to cost $275 million to $300 million as presently designed.

Gleason and County Council members met last week with Charles Bingman, deputy administrator of the Transportation Department's Urban Mass Transportation Administration, where Bingman restated the federal position.

He was asked to see whether Adams would write a letter promising to build the Glenmont line. Bingman told a reporter yesterday that "the Secretary sees no need for an additional letter. Mr. Gleason has the department's position."

Elimination of the Glenmont line, Bingman said, "is a potential outcome everybody should now act to prevent" by seeking stringent cost-cutting techniques.

Gleason and other county officials have said they do not believe that significant cost savings can be achieved, but that the line would be cost-beneficial because it would serve such a heavily populated area - the Georgia Avenue corridor north from Silver Spring. CAPTION: Picture, JAMES P. GLEASON . . . withholds $1.7 million subsidy