The Treasury Department yesterday formally overturned an eleventh-hour ruling by the Ford administration that allowed U.S. banks to reap millions of dollars in tax savings on subsidized loans to borrowers in Brazil.

In a new ruling by the Internal Revenue Service, the department declared that U.S. banks no longer will be able to claim full foreign tax credits for a 25 percent "tax" that Brazil imposes on interest the banks earn there.

Although the tax may seem high, Braziliam authorities routinely rebate 85 percent of it to the borrowers. But with paper "tax payments" they can use to offset their federal taxes here.

According to some calculations, Citicorp, the parent firm of Citibank of New York, the nation's second-largest bank, will save $9 million on its 1976 taxes because of the Ford administration ruling.

Yesterday's ruling reversing the Ford administration policy will not affect Citicorp's 1976 tax bill. But it is expected to cut into future tax savings fof Citicorp and 16 other large U.S. banks ehich lend heavily in Brazil.

Under yesterday's ruling, U.S. banks may only claim foreign tax credits on the 15 percent of the Brazilian tax that os retained by that government. The remaining 85 percent that is rebated may not be used to offset U.S. taxes.

The new ruling is retroactive to March 16. The restrictions apply in full for the all loans made since then. For those in effect in before that date, or near closing, the rebated "taxes" will be creditable through 1979.

The earlier ruling which had allowed the banks to claim the full credits was approved in the closing months of the Ford administration by then secretary of the Treasury William Simon over objections of Treasury experts.

The situation came to a head when a tax reform group, Tax Analyst and Advocates, disclosed that the IRS had handed down 16 unpublished rulings favoring major U.S. banks with substancial lending abroad.

Treasury tax experts' objections to the earlier ruling apparently were based on the fear that it would set a precedent for subsidizing loans by U.S. banks in other countries.

The Brazilian tax-and-rebate system stems from an effort that government began in 1974 stimulate investment by reducing the interest cost on loans by foreign banks.

Under the procedure, Brazil withholds a tax equivalent to 25 percent of the interest charges on a loan. Of this, it keeps 3.75 percent of the charges as a genuine tax, and rebates the other 21.25 percent to borrowers.

U.S. law allows american corporations and individuals to claim a credit for taxes paid to foreign governments that effectively enables them to reduce their U.S. federal income taxes by the amount they pay in income taxes abroad.

The provision is intended to spare companies and citizens from double taxation of their foreign earnings, first by another country and then by the U.S. However, disputes often arise over which taaxes are creditable.