Mobil Corp., the second-largest U.S. oil company, reported yesterday that its third-quarter earnings dropped 29.8 percent, primarily because of lower foreign inventory profits and foreign exchange losses.

Ashland Oil Inc., ranked 17th, had a 39.7 percent gain for the July-September quarter, which was its fourth, while Cities Service Co., the 19th-largest, recorded a 16.1 percent earnings decline.

Mobil's third-quarter earnings fell to $506 million ($1.19 a share) from $721 million ($1.70) in the 1980 third quarter. Revenues rose to $16.8 billion from $15.7 billion.

Nine-month earnings were $1.846 billion ($4.34), down from 1980 nine-month net income of $2.255 billion ($5.31). Revenue, however, increased from $46.3 billion to $50.5 billion.

Mobil said its foreign inventory profits plummeted by $195 million in the latest quarter. The company also had foreign exchange losses of $20 million after breaking even in the 1980 third quarter.

Third-quarter profits have declined at Mobil, Exxon Corp., Texaco Inc. and Standard Oil Co. of California--the four U.S. partners in the Arabian-American Oil Co. that produces the bulk of Saudi Arabia's crude oil.

"The so-called Aramco advantage is no longer in hand," said Al Silber, an analyst at Dean Witter Reynolds Inc. Exxon had a 20.7 percent decline in the third quarter, Texaco a 7.3 percent drop and Socal a 15.5 percent slump.

For the past 2 1/2 years the Aramco partners have had a competitive edge over other U.S. oil companies because Saudi crude has been cheaper than that sold by the other members of the Organization of Petroleum Exporting Countries.

But the partners have been forced to discount some Saudi crude to avoid hefty storage costs in the glutted world market.

"There will also be a penalty against fourth-quarter earnings as the Aramco partners sell off excess crude at a loss combined with the high cost of carrying surplus inventories," Silber said. "But if overly large inventories are brought back to normal levels in 1982, this is apt to produce positive earnings for the Aramco partners."

Mobil's third-quarter earnings benefited from a $100 million reduction in U.S. oil inventories. But Mobil's nonenergy results weakened, partially reflecting lower real estate earnings because of a one-time gain in the 1980 third quarter.

Ashland earned $49.2 million ($1.45 a share) in its fiscal fourth quarter vs. $35.2 million ($1.12) a year earlier. Revenues were up 17.7 percent to $2.52 billion from $2.14 billion.

Ashland attributed the improved results to increased profit margins resulting from its decision to reduce its reliance on high-priced foreign crude.

Earnings for Ashland's fiscal year were down 56 percent to $90.0 million ($2.22) from $205.1 million ($6.80) a year ago. Revenues excluding excise taxes rose 14 percent to $9.26 billion from $8.12 billion.

Cities Service's third-quarter earnings declined to $77.6 million (94 cents a share) from $92.6 million ($1.11) in the same period last year. Revenues were up 28.1 percent to $2.14 billion from $1.67 billion.

The company cited higher exploration expenses.

Nine-month earnings were $225.8 million ($2.72), down 39 percent from $369.7 million ($4.44) in the same period last year. Revenues rose 17 percent to $6.71 billion from $5.72 billion.