Sea-Land Service Inc. beat out two other bidders to acquire the last three remaining United States Lines Lancer-class vessels for a total of $22.8 million.

The average price of the ships, $7.6 million, fell below those in a similar sale two weeks ago in New York when five ships were purchased by the Puerto Rico Maritime Shipping Authority for an average of $8.82 million each. Sea-Land was the losing bidder for those vessels.In a surprising move, the strongest competing bidder in the San Francisco auction was Malcom P. McLean, the former chairman of USL and the pioneer of containerization.

Eastern Overseas, a New York shipbroker, submitted a bid for just one of the vessels, the Sea-Land Liberty. It did not bid on the other ships.

USL and its parent company, McLean Industries Inc., filed for protection

from creditors under the federal bankruptcy code in November 1986 after posting huge losses. Ironically, Mr. McLean was the chief executive of Sea- Land, which won the bidding, in the 1950s and '60s.

Mr. McLean said in court that he hoped to return to the shipping business. We overexpanded, got into rate (pressures) and had to take Chapter 11, he said. If we can get some opportunity, I think maybe we can start again. He declined to say what his plans were.

The three ships auctioned in the lobby of the federal courthouse in San Francisco late Tuesday represent the last of USL's maritime assets.

Last month, Sea-Land, a unit of Richmond, Va.-based CSX Corp., purchased the 12 Econships formerly operated by USL for $13 million to $14 million each. The vessels are the largest containerships ever built and were used in USL's ill-fated round-the-world service.

Sea-Land will charter space on the vessels to Trans Freight Lines and Nedlloyd Lines, each of which also is chartering one of the jumbo containerships from Sea-Land. The companies will operate the vessels in three separate services from U.S. Atlantic and Gulf ports to northern Europe and the Mediterranean. The arrangement is expected to take effect next week, pending approval by the Federal Maritime Commission and the U.S. Department of Justice.

The latest sale in San Francisco is subject to a confirmation hearing and the possibility of an upset bid Friday, although the law appears to be vague on the status of such bids and reportedly subject to the interpretation of the judge.

The three steam-turbine ships auctioned Tuesday were built in 1968 and 1969. Each has a capacity of 1,300 20-foot containers. The ships were formerly known as the American Legion, American Lark and American Liberty.