Faced with a funding shortage, the State of Maryland will stop subsidizing commuter rail lines now carrying 2,500 passengers daily from Baltimore and Brunswick to downtown Washington and back, according to Transportation Secretary James J. O'Donnell.

The cutbacks are not immediate, however. The two Baltimore to Washington Conrail trains will continue to operate until late next year or 1982, when the state's sublease of eight passenger cars expires. The Brunswick train will continue until the scheduled opening of the Shady Side Metro subway stop in 1983.

"We can no longer afford to finance competing public transportation systems in the same corridor," O'Donnell said of the Brunswick line operated by the Baltimore & Ohio Railroad with matching federal and state subsidies amounting to $1.8 million a year. Some 1,750 passengers now make the round trip, but their fares pay only 41 percent of the cost.

Nearly 700 riders fill the Conrail commuter trains each way between Baltimore's Penn Station and Washington's Union Station. O'Donnell suggested they consider using the Metro from New Carrollton or switching to another state-subsidized train stopping at Baltimore's Camden station.

O'Donnell said the measures are necessary because gas tax receipts this year have been 10 percent less than in 1970, while transportation titling and transfer fees are down a third.