ANNAPOLIS, NOV. 15 -- Maryland Transportation Secretary Richard H. Trainor, a prime mover behind the state's recent ventures into trolley lines, announced today that he would retire as soon as a replacement is named.

Trainor became the first Cabinet secretary to depart as Gov. William Donald Schaefer prepares for his second term. Schaefer said he did not seek Trainor's resignation.

"During the last four years, Dick has overseen the most extensive road-building and repair programs in state history," Schaefer said. "His vision was the force behind the decision to expand our mass transit system with light rail and to increase commuter train and bus services."

The light rail projects, however, also caused strong criticism of Trainor. The trolley line scheduled to connect Hunt Valley in Baltimore County to Glen Burnie in Anne Arundel County, a project that Schaefer pushed through a reluctant General Assembly in 1988, has been plagued with millions of dollars in cost overruns.

A second major project, the proposed Bethesda-Silver Spring trolley for which the state has committed $100 million, was thrown further into doubt by the election of Montgomery County Council member Neal Potter as county executive. Potter believes the project requires more study.

Trainor, 61, has been a strong proponent of increasing the state gasoline tax, an idea once seen as likely but now being scaled back because of economic uncertainties and a recent federal tax increase.

Schaefer said he plans to retain Trainor as a part-time consultant on special projects. Specifically, Schaefer today mentioned asking Trainor to study the condition of Maryland bridges.