It looked like a happy ending to metropolitan Washington's sewer wars, which seem to have more sequels than "Star Wars."

Sitting together, smiling into the television cameras, were the District of Columbia's mayor Marion C. Barry, Montgomery County Executive Charles W. Gilchrist, Fairfax County board Chairman John F. Herrity and Jack J. Schramm, regional administrator of the Environmental Protection Agency.

They and assorted other local officials gathered yesterday at the Metropolitan Washington Council of Governments headquarters to announce an "agreement" on Blue Plains, the giant regional sewage treatment plant in Southwest Washington over which many of the wars have been fought. Under the agreement, all localities using the plant will be granted permission to send more sewage there, thus averting the possibility of a sewer-imposed building moratorium in the area.

As it turned out, the principals had merely checked their guns and knives just outside the door to COG's sleek meeting room.

While Herrity was saying "I think all of us can be proud of the level of regional cooperation which this agreement represents," on the other side of town, Montgomery was suing Prince George's County's sewer comissioners for contempt. And Montgomery County Attorney Nathan Greenbaum's prose before U.S. District Court Judge John Lewis Smith Jr. did not include any paeans to "regional cooperation."

Instead, said Greenbaum, the refusal of the three Prince George's commissioners to support construction of a sewage-sludge composting plant in Montgomery near their county's border "constituted clear, willful, intentional, unequivocal and contemptuous violations" of the judge's repeated orders that the plant be built. Smith rejected the Montgomery request.

At the COG meeting, the facade of harmony cracked enough for Barry to note the absence of Prince George's Executive Lawrence J. Hogan. "I was hoping Larry was going to be here so I could do a little refereeing between him and Charley (Montgomery's Gilchrist)," the mayor said.

The unity also dissolved enough for Montgomery officials to slip through a copy of the ultimatum that Gilchrist sent to Barry on May 16. "Montgomery County will be unable to receive the District's proportional share of undigested sludge (after September)," Gilchrist told Barry, in the letter.

Asked how that ultimatum squared with the cooperation being extolled at COG yesterday, the District's acting director of environmental services, William B. Johnson, said: "We don't believe that (September) deadline."

After the TV cameras and microphones were turned off, Montgomery and Prince George's officials struck the same adversarial pose that their attorneys were presenting in Judge Smith's courtroom in Judiciary Square.

"I wish Prince George's would get over its psychological problems," complained Montgomery County Council Vice Chairman Ruth Spector. "They think they're the only people in the metropolitan area who treat sewage."

The Prince George's representative at the COG ceremony, Kenneth V. Duncan, county administrator under Hogan, said, "At some point, you would hope Montgomery would recognize that Site 2 (the land near Prince George's where Montgomery wants to build the sludge facility) is not going to fit in the plan . . . Prince George's is far ahead of Montgomery in sludge-disposal plans, I assure you."

The agreement announced yesterday actually is predicated on the promise of a long-term regional solution of the sludge issue. As of yesterday, such an agreement seemed about as likely as a snowstorm on Labor Day, which happens to be just about the deadline imposed by EPA on the localities -- a fact that was not emphasized at yesterday's meeting.

Sludge is an enormous problem for the region because each day Blue Plains produces 1,500 tons of the stuff and starting next spring the daily output will rise to at least 1,900 tons daily.

The scenarios for disposal have developed more complications than a soap opera.

As a stopgap solution, Montgomery and Prince George's are burying the sludge in trenches on prime farm land. New sites are needed, but in Montgomery a new upcounty group, called Citizens for Responsible Disposal, has formed to fight trenching in their area.

After the warm glow from yesterday's COG meeting cooled down, the EPA's Schramm said: "If Prince George's and Montgomery are still tied up after 90 days (the deadline set by the enforcement agency) that tells EPA there has been no breakthrough, and we may have to go into court and mandate action."

That, off course, would guarantee another episode in sewer wars.