A federal judge dealt Mobil Corp. a crushing, potentially fatal blow yesterday in its fight to take over Marathon Oil Corp.

U.S. District Court Judge Joseph Kinneary ruled in Columbus yesterday that key parts of a merger agreement between Marathon and U.S. Steel are legal, removing the major obstacle to the steel company's takeover bid. The ruling apparently clears the way for U.S. Steel to begin purchasing Marathon shares on Dec. 15.

In the meantime, Mobil's takeover bid is barred by another federal court.

Kinneary described as "without merit" arguments by Mobil that the agreement between the steel company and Marathon was a sweetheart deal that disregarded stockholders' interests.

Mobil had challenged two key clauses in the agreement that gave U.S. Steel the right to buy 10 million shares of Marathon and to acquire a major portion of its oil and gas reserves even if Mobil or some other party acquired Marathon.

Since Mobil's aim in attempting to take over the smaller oil firm was to acquire its valuable oil and gas reserves, upholding the options reduces the chances that Mobil or any other oil company would fight to acquire Marathon. Mobil said it will appeal Kinneary's ruling.

Mobil could buy time for its bid by making another offer for Marathon. After U.S. Steel bid for the smaller oil firm, Mobil made a second, higher offer for Marathon. But Mobil said at the time that the offer might be withdrawn if the U.S. Steel options were upheld.

Yesterday Mobil anounced that it has reached an agreement with Amerada Hess Corp. in which Amerada Hess would acquire all Marathon's marketing, refining and transportation properties if Mobil takes over the company. That agreement is aimed at overcoming antitrust objections that have blocked Mobil's proposed takeover.

Industry analysts suggested yesterday that if the agreement isn't sufficient to get the courts to lift injunctions against Mobil's takeover, Mobil might try yet another takeover bid--this time in conjunction with Amerada Hess and at a still-higher price than its existing $6.5 billion offer. A new tender offer would buy some time for Mobil by triggering a 10-day delay before U.S. Steel could purchase stock.

Mobil had no additional comment on Kinneary's ruling. Marathon released a statement saying that it was delighted with the ruling. "We believe the U.S. Steel offer is in the best interests of Marathon shareholders, employes and customers," a spokesman said. "Our agreement with U.S. Steel is proper, valid and legal."

Mobil had asked Kinneary to grant a preliminary injunction against U.S. Steel's tender offer for Marathon, arguing that the agreement between the steel company and Marathon was designed to protect Marathon management rather than its shareholders. Kinneary had blocked Mobil and U.S. Steel from buying any Marathon shares until five business days after his ruling. The decision yesterday removed that impediment. Mobil is barred from buying any Marathon stock under a Cleveland federal court injunction that Mobil is appealing.

U.S. Steel said Sunday that its offer to buy 51 percent of Marathon's stock at $125 a share had been "substantially oversubscribed," with more than the 30 million shares required tendered. Until yesterday, however, it was not clear when U.S. Steel would be able to move ahead with its acquisition.

Mobil and Amerada Hess yesterday announced their agreement for Amerada Hess to take over Marathon's "downstream" operations if Mobil wins the takeover war. Although the announcement did not spell out the terms under which Amerada Hess would acquire those marketing, refining and transportation properties, industry analysts said it was certain to be at a bargain price.