Mobil Corp. stockholders yesterday overwhelmingly approved several measures designed to make a hostile takeover of the company more difficult.

During a special stockholder meeting at Mobil's Fairfax offices, Chairman Rawleigh Warner Jr. also disclosed that the company has retained Goldman, Sachs & Co. to advise Mobil about the possible sale of certain subsidiaries. Analysts said yesterday they believe the company will try to sell its Montgomery Ward & Co. unit, the giant retailer that has hurt Mobil's earnings for most of the decade the company has owned it.

"I've said for some time that the first time Montgomery Ward showed a decent profit they would try to sell it," said Monroe H. Greenstein, a retailing analyst at Bear, Stearns & Co. in New York. "Montgomery Ward has been nothing but a drain for them over the years."

"We are doing better with Montgomery Ward, but we are not doing adequately," Warner said, in response to a question from a stockholder.

Mobil was the most active stock on the New York Stock Exchange yesterday, up 1 7/8 to close at 29 with nearly 2.6 million shares changing hands.

The changes passed yesterday by Mobil stockholders include a measure to prohibit the payment of "greenmail," a premium that some companies have paid corporate takeover specialists who buy stock and threaten to buy more unless their stock is repurchased. Also approved were a measure that staggers the board terms served by Mobil directors, making it impossible to replace a majority of directors in one election, and a fair price provision, designed to guarantee that all stockholders receive the same price if there is a successful takeover.

All of the new provisions are similar to those approved recently by other corporations concerned about a possible takeover. Warner said the measures were not designed in response to any bids for the company. "We do not see any sign of anybody trying to make a run at us," he said.

Warner said Mobil will continue to try to cut costs to improve profits, amidst weak demand in the oil industry. He said the next few years look like they are going to be difficult for oil companies.

Some stockholders yesterday questioned the company's decision to sell former Mobil president William P. Tavoulareas a cooperative apartment it owned in Manhattan. Under terms of the agreement disclosed in Mobil's proxy, the company agreed to sell the apartment, which it acquired in 1970 for $74,000, to Tavoulareas for $325,000.

Under the agreement, Tavoulareas paid the first installment of $25,000 on Jan. 1 and has agreed to pay $100,000 on Dec. 31 for the next three years. Mobil will pay two-thirds of the apartment's approximately $36,000 maintenance fee this year and one-third next year.

Stockholders complained that Mobil actually is giving Tavoulareas an interest-free loan since he has three years to pay the $325,000. Warner said it was an "arms-length transaction," typical of the company's policy of making New York accommodations available to executives for business use.

"This agreement contemplates that Mr. Tavoulareas will work approximately one-half time at an annual rate of $800,000," the proxy said.

"Why must Mobil be involved in 'house hunting' for Mr. Tavoulareas?" Ret. Rear Admiral Clarence A. Hill Jr., asked in a Jan. 16 letter to Mobil.

"The arrangement under which he [Tavoulareas] purchased the apartment mentioned in the proxy was worked out with the aid of an outside, neutral consultant who advised on its fair value," said Mobil Vice President Herbert Schmertz said in his Jan. 31 reply to Hill.