Suburban Maryland and the District yesterday announced a far-reaching agreement on their sewer disputes that will speed the end of a seven year-old moratorium on new development in parts of Montgomery and Prince George's counties.

The agreement also enhances prospects that Montgomery will win its pegal fight with the Environmental Protection Agency to build a big regional sewage treatment plant at Dickerson.

"This represents a hallmark agreement for the region," said David G. Sobers, director of Montgomery's Office of Environmental Planning.

In the District, planning director Ben W. Gilbert said, "The agreement takes care of our concerns into the foreseeable future. We can go ahead with an orderly growth plan."

The agreement, reached after a stalemate of more than a year, has these provisions:

The District will join Montgomery in the county's suit seeking to force EPA to fund the Dickerson plant, which suburban Maryland has called "the key to the regional (sewage treatment) solution." The plant would cost $375 million to $400 Million to build.

The District will drop its opposition to completion of the expanded Anacostia sewage line from Bladensburg to the Blue Plains regional treatment plant in far Southwest Washington. Oncethe connection is made, probably in 1980, Montgomery and Prince George's would be able to tap some of their surplus capacity at Blue Plains, and thus end the moratorium on residential and commercial development in the Rte. 29 Interstate Rte. 95 area northeast of the Capital Beltway.

Montgomery will drop its suit against the District on sewage allocations at Blue Plains, giving the District an additional 4 million gallons daily capacity, in addition to its current 131 million gallons.

Montgomery and Prince George's will reaffirm their commitment to provide the District a total of 15 million gallons daily capacity at Dickerson, if it is built, and the present Piscataway treatment plant when it is expanded in the mid-1980s. The commitment, the agreement says, could be expanded to 20 to 25 million gallons a day. Suburban Maryland also will give the District up to 2 million gallons of capacity if the city needs it before Dickerson is ready or Piscataway expanded.

Agreement came, Montgomery's Sobers said, after "150 hours of very intensive negotiations" involving the District's Gilbert; Montgomery's chief administrative officer, William H. Hussmann; and Prince George's chief administrator, Robert W. Wilson.

These principals entered, the negotiations in late spring after lower-level technical staff meetings "just weren't getting anywhere," in Sobers' words.

Perhaps the most significant element of the agreement is the District's decision to join Montgomery in its suit seeking to get Dickerson built and agree to finance part of it. In vetoing the 60-million plant in August, 1976, then EPA administrator, Russell E. Train, said it was bigger and costlier than necessary. He urged Montgomery to seek a scaleddown alternative that would include regional sewage commitments, a solution that would have to include the District.

But the District, angered by Montgomery's suit on Blue Plains allocations - the county claimed the city was using more capacity than it was entitled to - was in no mood to accept the Train-suggested commitment.

Now the city is willing to make that commitment - a factor that U.S. District Court Judge John Lewis Smith Jr. will be considering when he takes up the Dickerson issue oct. 6 Montgomery, now joined by the city, will be asking Smith to order the EPA to build the plant, which, if built, would probably increase growth in Montgomery.

In getting capacity at Dickerson, which could be ready by 1983 if Montgomery wins its suit, the District has agreed to pay its share of the plant's cost, which Sobers estimates in now close to $400 million. The city would also pay for its share of the expanded Piscataway plant.

Besides easing uncertainties about growth in suburban Maryland and the city, the agreement announced yesterday is likely to have an impact on Fairfax County's development.

If Dickerson is built and Piscataway expanded, Fairfax might be able to get some of the addional capacity it has been promised at Blue Plains, or it could buy into either of the Maryland facilities.

With these possibilities clouded by the dispute between the Maryland suburbs and the District, Fairfax has been pursuing a solution of its own - a project where sewage would be diverted from the county's Blue Plains line to the county's lower Potomac treatment plan, which is now being expanded. But that project hinges on federal funds that have not been granted.

The agreement between suburban Maryland and the District could lead to Fairfax reconsidering the sewage diversion project and taking another look at the Dickerson-Piscataway regional solution.

However, the Virginia State Water Control Board has threatened to quit participating in regional efforts because, it claims, the Dickerson plant would be too expensive.