A U.S. court judge yesterday upheld the Environmental Protection Agency's veto of a major regional sewage treatment plant that would be built at Dickerson in upper Montgomery County.

The decision by District Court Judge John Lewis Smith Jr. not only makes Dickerson look less likely the ever, it throws into turmoil the region's recently drafted 20-year plan to clean up the Potomac River.

The major component of the 20-year plan, which was adopted last week by the Metropolitan Washington Council of Governments, is Dickerson. The plant, whose cost has been estimated at more than $400 million, would have handled Montgomery's sewage treatment needs into the 21st century and also provides extra treatment capacity for the District of Columbia, which is approaching the limits of its allocation at the Blue Plains regional plant.

Montgomery has no specific alternative to Dickerson, which has aroused widespread opposition because it would cost so much, discharge effluent abbove drinking-water intakes and consume great amounts of energy to pump sewage 24 miles uphill.

Montgomery County Executive James P. Gleason, perhaps the most outspoken advocate of the controversial Dickerson proposal, said the county would appeal yesterday's decision in which Smith said EPA had not acted arbitrarily or capriciously in vetoing Dickerson.

"I am disappointed," he said. "We'll just have to get a higher judicial review. The whole matter has to be resolved. It's atrocious it's gone on this long."

As he has so often in the past, Gleason fired a volley at the federal government. "We are being choked to death by federal bureaucracy," he said. "They reject our initiative and don't offer any construction direction on what we can do next."

However, Montgomery County Counci member John L. Menke, who has led the opposition to Dickerson on the closely divided council, said: I applaud the judge's decision. It has become clear over the years that Dickerson was oversized and its cost was underestimated. . . In addition, there are serious question about the plant's reliability. There are also questions about the safety of discharging effluent above the D.C. area's water intakes."

Dickerson was vetoed by the EPA in August 1976 on grounds that it was too costly and that Montgomery had failed to reduce the size of the proposed plant despite lower population projections that were made in the fall of 1975. EPA did not say Dickerson was a potential health hazard.

Montgomery and the state of Maryland then sued EPA asking Judge Smith to order the agency to continue processing the Washington Suburban Sanitary Commission's application for 75 percent federal funding of the project. Last October, Smith told the two sides to try to negotiate a compromise that would permit some sort of plan to be built at Dickerson. No compromise was reached.

Montgomery Council member Menke said the County should lose no time in finding an alternative to Dickerson. "We have from five to eight years of sewer capacity left," he said. "That's just about how long it takes to build a new facility. We are on the edge of an inescapable moratorium."

Montgomery got into a sewer bind in the early 1970s, and large parts of the county, as well as sections of Prince George's County, were put under a moratorium on sewer connections that slowed development and helped drive up the price of housing. With the construction of small, interim plants Montgomery has gained new capacity - and, with population growing at a slower rate, demand has eased.

The District of Columbia, which is experiencing new development, both private and federal, has had to find additional treatment capacity beyond the 135-million-gallons daily to which it is now entitled at Blue Plains.

The city decided last year to join the Montgomery-Maryland suit against EPA in exchange for Montgomery's not contesting the city's claim that it had an additional four million gallons of capacity at Blue Plains.

"There's no wavering on our part," D.C. Planning Director Ben W. Gilbert said yesterday after Judge Smith's decision. At the same time, Gilbert said that "If we start to scrap against our 135-million-gallon limit, we will claim additional capacity to which we think we are entitled."

Some local officials said yesterday that Smith's decision will force regional leaders to sit down soon and draw up a revised 20-year plan to clean up the Potomac. While the present COG draft plan has a contigency, in case Dickerson loses in the courts, the contigency does not spell out where sewage will be treated in Montgomery - and this imprecise language is opposed by Prince George's.