When the Maryland General Assembly opened in January, House Speaker Benjamin L. Cardin was optimistic that he would cap his 19th and final year in the House of Delegates by winning approval for his plan to guarantee a $247 million increase in education funding during the next six years.

The Baltimore Democrat crossed his first hurdle in the House but, before he could claim a total victory, he ran into a solid wall of opposition in the Senate. Among his critics are Senate President Melvin A. Steinberg (D-Baltimore County) and Democratic Sen. Laurence Levitan, a committee chairman from Montgomery County who argues that his wealthier jurisdiction would bear the brunt of financing the education package for the rest of the state.

Cardin has been trying to figure out a way to get senators to support the extension of an education aid formula that the legislature approved in 1984 only after considerable vote-trading. Cardin's problem this year is that there are few votes to trade.

Enter Baltimore Mayor William Donald Schaefer who, as a candidate for governor, has been nearly invisible in the state capital this year. Today, he roamed the hallways of the State House, talked to legislators and dropped in for private chats with Cardin and Steinberg.

"Every budget in Baltimore City and other places is predicated on police, fire and education," Schaefer said in an interview outside the State House as a camera crew filmed a campaign commercial of him in action. "If you even have an inkling that that money is going to drop off in 1989, it's bad."

Cardin has argued that his plan is the only way local jurisdictions can be assured that state aid increases mandated in 1984 will not be curtailed dramatically in 1989, when the current aid formula expires.

"I was really naive," Cardin said today. "I really thought the merits of the proposal would carry it."

If anything can salvage the measure in the final weeks of the legislative session, it is Schaefer's involvement, Cardin said. Even so, after meeting with Schaefer, Steinberg would promise only to keep an open mind on the issue. "If we don't spend the additional money this year or next year, it is a negative message to people who care about public education in Baltimore City, Prince George's County and the poorer subdivisions," Steinberg said.

But Schaefer's plea may fall on deaf ears in the Senate Budget and Taxation Committee, headed by Levitan, which must approve the bill.

"Politically, for Montgomery County, it stinks," Levitan said. "It's not anything that has to come through this year."