State officials are working on a plan to free as much as $100 million in deposits at the troubled Old Court Savings and Loan Association by transferring the funds and an equal amount in mortgage loans to a commercial bank, government and industry sources said today.

Preliminary discussions have begun with at least three major Baltimore banks, according to one thrift industry source, who said the plan is the most likely scenario for the state to grant relief to some of the 55,000 Old Court depositors whose accounts have been tied up since May.

Old Court, where reports of management problems triggered a broad thrift industry crisis, has been under state conservatorship for more than four months. Its depositors have been subject to a strict withdrawal freeze since early June.

In a related development, Mellon Bank Corp. of Pittsburgh was reported to be taking a serious look at acquiring two of the largest state S&Ls still lacking federal insurance: Gibraltar Building and Loan Association of Annapolis and Sharon Savings and Loan Association of Baltimore.

Under the Old Court proposal being shaped by state officials and Chevy Chase Savings and Loan managers who are operating Old Court, a commercial bank would assume up to $100 million of the thrift's commercial loan portfolio and an equal amount of deposits. Old Court currently has about $574 million in assets and $748 million in liabilities, including $150 million borrowed from the Federal Reserve.

Barring any legal complications, the deposits that would be assumed by the bank, and immediately unfrozen, would be among those held by state residents. Giving Maryland residents priority in recovering their funds would be politically beneficial for Gov. Harry Hughes and other officeholders who are feeling increasing pressure from angry constituents denied use of their savings.

Hughes, at his latest regular news conference, pledged that the state would soon design a plan to provide relief to Old Court depositors with "hardship cases."

While confirming that the plan was under consideration, state Economic Development Secretary Thomas H. Maddux described it today as only one of a dozen possibilities being studied for relieving hardships among Old Court depositors. The proposal, Maddux said, is "more complicated than I thought it would be."

But another source in the savings and loan industry said the plan has progressed to the point that the Chevy Chase team at Old Court has begun assembling the $100 million in mortgage loans that would make the proposal attractive to a bank. The loans would be composed primarily of real estate venture loans, the industry source said, because much of Old Court's residential and prime commercial mortgages have been pledged as collateral to back up federal and state loans used to bolster the thrift's liquidity during the May crisis.

The industry source said state officials have begun talking to officials of three Baltimore banks, Union Trust, Equitable and Maryland Na-tional. Bank officials have been receptive to the plan, he said.

Any plan proposed by the state would have to be approved by Baltimore Circuit Court Judge Joseph H.H. Kaplan, who is overseeing the conservatorship.

If Mellon, the nation's 11th largest bank company with $30.6 billion in assets, completes a deal to acquire a Maryland savings and loan, it would become the third large out-of-state bank poised to enter the Maryland market.

Chase Manhattan Corp. has already announced agreements to buy Friendship Savings and Loan and Chesapeake Savings and Loan, and is expected to announce soon an agreement to take over the troubled Merritt Commercial Savings and Loan. In addition, Citibank (Maryland) N.A., a subsidiary of the giant New York bank company Citicorp, has agreed to buy First Maryland Savings and Loan of Silver Spring. All those acquisitions would require legislative approval.

Industry sources regard Gibraltar, a medium-sized thrift with $136 million in assets, as a prime candidate for acquisition. Citibank also has appeared interested in Gibraltar, sources said. Sharon, a Baltimore thrift with $166 million in assets, appears less likely to be acquired because in a joint application with Security Savings and Loan, it has won conditional approval for federal insurance.