A federal judge ruled yesterday that Mobil Corp. may solicit shares of Marathon Oil Co. but continued a prohibition against their purchase until the court resolves whether the proposed $5.1-billion takeover should be enjoined.

Marathon announced plans yesterday to borrow $5 billion under an arrangement with a consortium of 57 banks led by Chase Manhattan. As much as $2 billion of that amount may be used to buy the company's own stock under a modified agreement with the banks that also would allow Marathon to use borrowed funds for an unfriendly takeover of its own.

Marathon representative Mike Russo said the company has made no decision involving use of the borrowed funds. The arrangements were made to give Marathon flexibility to respond to new developments, he said, adding "we want to be in a position to do whatever we do quickly."

In still another development in the fight for control, several members of Congress, including influential Republicans, called for thorough scrutiny of the antitrust implications of the takeover.

Senate Commerce Committee Chairman Robert Packwood (R-Ore.) joined Sens. John C. Danforth (R-Mo.) and Wendell H. Ford (D-Ky.) in a letter to the chairman of the Federal Trade Commission calling for "a thorough investigation of the proposed acquisition." Sen. Thomas Eagleton (D-Mo.) sent a similar letter.

On the House side, Rep. Clarence J. Brown introduced a bill that would require a Cabinet-level evaluation of takeovers of midsize domestic oil companies by major international oil firms and a moratorium on such takeovers until June 30, 1982.

"What concerns me in the trend of takeovers is that the international oil giants . . . would rather explore for oil on the floor of the New York Stock Exchange than in the riskier world of the oil patch," Brown said. Brown, who has said he will run for governor, represents a district adjoining the one where Marathon's headquarters are located in Findlay, Ohio.

"Based on what we know about the oil industry, we believe that this acquisition could violate antitrust laws in that it could tend to lessen competition in the markets for the products the two companies sell," the senators wrote. "Thus we believe that, at this juncture, the public interest would be best served by the most thorough inquiry possible into the competitive ramifications of the proposed acquisition."

The FTC is conducting an antitrust review of the takeover bid and has until Saturday to request additional information from the companies, usually a sign that the review is more than routine.

U.S. District Court Judge John M. Manos in Cleveland yesterday dissolved a court order that prevented both Mobil and Marathon from talking about the takeover bid. He also extended a temporary restraining order issued last week barring Mobil from purchasing Marathon stock but modified it to allow the larger company to solicit Marathon shares and to accept their tender. A hearing on a request for a preliminary injunction will be held next Tuesday.

Mobil said it was pleased that Marathon shareholders are free to express their views on the adequacy of Mobil's offer. Marathon's board urged shareholders to reject Mobil's offer to buy 40 million shares, calling the offer inadequate.

Under the court's ruling, several key dates in the offer were extended. The date after which payment for shares would be pro-rated if the offer were oversubscribed was postponed to Nov. 21. The date for withdrawing shares tendered to Mobil was extended to Dec. 1, and the expiration date was moved to Dec. 11.

The takeover bid has provoked a tremendous amount of concern in Findlay, a town of 35,000 where Marathon is based. Mobil's success "would literally have a devastating economic effect on Findlay," said Rep. Michael G. Oxley (R-Ohio), whose district includes Findlay.