The Amtrak budget approved by Congress over the weekend ensures the survival of Washington's once-endangered commuter rail service for at least two more years.

For almost a year federal and state officials had sought, as economyu moves, to eliminate federal and state subsidies for 16 of the 24 commuter trains now serving Washington, including all trains between Washington and Harpers Ferry, W.Va. More than 7,000 commuters now ride these trains daily, according to the Maryland Department of Transportation.

But the last-minute rescue of the Blue Ridgek and other Amtrak commuter trains by Congress and a similar last minute reprieve in May for more than a dozen Maryland commuter trains, means that the weekday commuter operations serving the capital will remain intact at leastg until 1983.

The Blue Ridge, which carries 500 to 600 passengers between Washington and Martinsburg, W.Va., every day, was one of 27 so-called "sunset trains," serving eight eastern and midwestern cities, that had been doomed by Congress for elimination Sept. 30.

Under the two-year Amtrak budget just approved by Congress, those sunset trains meeting minimum ridership standards -- short-haul trains carrying at least 80 passengers at any one time -- will be continued. The Blue Ridge last year carried 189 passengers at the least and now often has standing room only for much of the train's 74-mile trip, according to an Amtrak spokesman.

In addition to giving a new lease on life for most of Amtrak's remaining commuter trains, Congress may allow Amtrak to honor the cut-rate commuter rail tickets sold by other railroads, which can sometimes save commuters as much as 50 percent on their tickets. Last year Congress told Amtrak to stop honoring commuter tickets as of Sept. 30, 1981.

Washington commuters ride at least two daily Amtrak trains besides the Blue Ridge that are not affected by last week's congressional action: the Chesapeake, which carries more than 600 passengers a day between Washington and Philadelphia, and the Shenandoah, which carries as many as 300 passengers a day between Washington and Cincinnati.

The Chesapeake is funded entirely by commuter fares and a minor subsidy -- less than $100,000 a year -- from the states of Maryland and Pennsylvania. Until May, the Chesapeake's two daily runs were among the 16 commuter trains Maryland was proposing to eliminate.

The long-distance Shenandoah will be eliminated this fall by Amtrak as planned, but the 100 to 300 commuters it has been carrying should be able to find seats, or standing room, on the Blue Ridge and the 10 daily commuter trains operated by the B&O between Brunswick, Md., or Harpers Ferry and Washington.

Amtrak will reroute another lond-distance train, the Broadway Limited, along the same tracks used by the Shenandoah and the Blue Ridge with stops at the same stations -- Harpers Ferry, Brunswick, Gaithersburg, Rockville and Silver Spring. But the preliminary word from Amtrak is that the train will have different hours and that no commuter tickets will be honored on it. The daily Broadway Limited links New York and Chicago, with one section splitting off for Washington.

Besides the Blue Ridge and the Shenandoah, the historic Potomac River Valley rail line -- built in the early 1800s to compete with the C&O Canal -- also has 10 daily trains (five round trips) operated for Maryland by the B&O.They carry close to 4,000 passengers a day.

Between Baltimore and Washington both the B&O and Conrail operate commuter trains on parallel but separate tracks, Conrail using the Amtrak main line that now stops at Baltimore-Washington International Airport. Conrail operates four trains daily (two round trips), which Maryland had proposed eliminating, carrying about 1,400 passengers a day. The B&O operates eight trains daily on the Baltimore line, carrying about 3,800 passengers a day.

While Washington rail commuters now have been assured of trains to ride on, the cost of commuting by train also has jumped.

Fares last month rose an average 30 percent for most train commuters here. As a condition of approving the state share of the commuter rail subsidy the Maryland General Assembly insisted that riders pay 50 percent of the operating deficit. The commuter rail program last year cost $6.3 million, with fares paying $2.7 million of the costs and the state and federal governments splitting the $3.6 million deficit.