Citicorp, the second largest bank holding company, outearned No. 1 BankAmerica Corp. in the second quarter by posting a 41 percent profit gain on a sharp decline in its cost of obtaining funds.

Citicorp, parent of Citibank, said yesterday that it earned $174.2 million ($1.40 a share) compared with $123.9 million ($1.00) a year earlier. The increase followed a weak first-quarter performance so Citicorp's first-half net income was 1 percent ahead of a year earlier.

BankAmerica, whose Bank of America subsidiary is the world's largest commercial bank, reported net income of $174 million ($1.18 a share) in the second quarter, up 16 percent from the $150 million ($1.03) in the 1979 second quarter. In the first half, BankAmerica showed a 10.5 percent gain from the year-earlier period.

In the rivalry between the banking industry's goliaths, analysts said both BankAmerica and Citicorp had good second quarters but Citicorp benefited most dramatically from the decline in interest rates during the March-June period.

"BankAmerica was in line with our expectations for the second quarter but Citicorp was well above what we expected," said Thomas H. Hanley, banking analyst for Salomon Brothers.

While its domestic lending business continued to show losses in the quarter, Citicorp received a boost in the international area. It said its foreign exchange trading profits rose by $35 million to $94 million and that its currency translation losses were $34 million lower at $10 million.

Analysts downplayed the significance of Citicorp's second-quarter profits topping those of BankAmerica, which ranks No. 1 because of its larger deposit base.

"Who cares" was the reaction of analyst James G. Ehlen of Goldman, Sachs & Co. "What matters is the return on asets on an annualized basis," he said.

Citicorp's return on average total assets in the second quarter was 0.67 percent, up from 0.55 percent a year earlier. At BankAmerica, the latest return also was 0.67 percent, up from 0.66 percent a year earlier.

Before securities transactions, BankAmerica earned $174 million in the second quarter, up from $150 million, and $308.4 million in the first half, up from $279.1 million. Citicorp earned $176.7 million before securities transactions, up from $125.8 million in the quarter and $260 million, up from $251.1 million, in the first half.

Among other big banks reporting profits for the second quarter:

Manufacturers Hanover Trust Co., the country's fourth-largest commercial bank, showed a 7 percent earnings gain. Net income rose to $56.1 million ($1.69 a share) from $52.7 million ($1.61) a year earlier. In the first half, it earned $112.7 million against $103.8 million a year earlier before securities transactions.

Security Pacific National Bank in Los Angeles posted a 5 percent increase to $43.3 million ($1.56 a share) from $41.1 million ($1.49) in the comparable 1979 period. The bank is the 10th largest in the country.

Mellon Bank, the nation's 16th-largest, said its earnings rose 12 percent to $25.3 million ($1.29). Mellon Bank is based in Pittsburgh.

Wells Fargo & Co., holding company for the nation's 11th-largest bank, was the only major bank holding company to report a decline in second-quarter profits. Income fell 18 percent to $26.5 million ($1.16 a share) from $32.3 million ($1.43) in the comparable 1979 period.

Merrill Lynch & Co., riding the crest of high stock market volume and increased investment banking activities, reported yesterday that second-quarter profits rose 106 percent to $65.8 million ($1.80 a share) from $31.9 million (87 cents) in the 1979 second quarter.

The parent company of Merrill Lynch, Pierce, Fenner & Smith Inc. also said revenues rose 55 percent to $764.7 million from $492.8 million.

Merrill Lynch boosted its quarterly dividend to 28 cents a share from 24 cents.

First-half earnings were $100.8 million ($2.77), up from $51.6 million ($1.41). Revenues climbed to $1.46 billion from $930.9 million.

Rca Corp.'s second-quarter profits fell 9.9 percent to $77.1 million (80 cents a share) from $85.6 million ($1.13) in the same period last year despite a 5.95 percent gain in revenues to a record $1.96 billion from $1.85 billion, the company said yesterday.

First-half earnings increased by 5 percent to $155.8 million ($1.69) from $147.7 million ($1.94) as sales rose 8 percent to $3.93 billion from $3.64 billion.

RCA Chairman Edgar H. Griffiths said operating profits for the latest quarter -- which includes the acquisition of CIT Financial Corp. -- increased 32 percent from the year-earlier period, excluding the effects of certain unusual items.

RCA said the sale of its publishing division, Random House Inc., on April 28 contributed $10.8 million to second-quarter results. The company also said that earnings of National Broadcasting Co. would have been above last year's levels without a $16.1 million after-tax writeoff resulting from the curtailment of its coverage of the Moscow Olympics.

In addition, the sale of RCA Alaska Communications Inc. on June 1, 1979, added $23 million to last year's second-quarter results, the company said.

Republic Steel Corp. reported second-quarter rofits of $8.8 million (54 cents a share), down 80 percent from $42.2 million ($1.28) in the same period a year ago, as sales dropped to $893.8 million from $1 billion.

First-half profits also fell, to $29.5 million ($1.82) from $85.1 million ($5.26) for the first half of 1979, and sales were $1.89 billion compared with $2.04 billion a year earlier.

The company's shipments of 1.5 million tons in the second quarter were down 22 percent from the second quarter of last year.

Philip Morris Inc., whose products include Marlboro cigarettes, Miller beer and Seven-Up soft drinks, reported a 27.6 percent increase in second-quarter profits to $166.9 million ($1.34 a share) from $130.6 million ($1.05) a year earlier. Revenues increased 17.5 percent to $2.48 billion from $2.11 billion.

First-half earnings rose 26.7 percent to $304.6 million ($2.45) from $240.5 million ($1.93), and revenues climbed 17.9 percent to $4.73 billion from $4.02 billion.