United States banks had about $24.3 billion at risk in Mexico at the end of last year, about the same amount as in June, the Federal Reserve Board reported yesterday.

U.S. bank lending to Brazil rose from $20.7 billion to $22 billion during the same six-month period.

Mexico and Brazil, with more than $80 billion in foreign debts, are by far the largest debtor nations among the developing countries and both are having severe difficulties repaying those debts. The world's banks have renegotiated the terms on much of Brazil's and Mexico's debts and the banks and the International Monetary Fund earlier this year made new loans to the two troubled countries.

However, banking sources said, Brazil was denied, at least temporarily, about $1 billion in loan payments it was due to collect last Tuesday because the country was not in compliance with some key economic conditions set by the IMF.

The figures released yesterday do not reflect new lending to Brazil and Mexico made this year under the terms of the rescue packages. Nor do the figures reflect all of the moves by smaller U.S. banks as well some European banks to reduce their lending to Brazil. Bigger U.S. banks, however, have made up some of the shortfall.