Mexico has reached a financing agreement with the International Monetary Fund that will test the willingness of U.S. commercial banks to extend additional loans to the debtor nation, government sources here said today.

Mexican Finance Minister Gustavo Petricioli plans to sign the agreement at the IMF in Washington Tuesday.

The IMF accord is the linchpin of an approximately $7 billion financial rescue package Mexico says it needs to keep current with debt payments and revive its economy, which is mired in recession. About $1.5 billion would come from the IMF and the remainder from commercial banks. Petricioli will outline the plan to Mexico's bankers at a meeting in New York Wednesday.

The economic program presented to the IMF calls for real growth of 3 to 4 percent in 1987 and 1988, an upturn many economists say can be achieved only by loosening credit restrictions and risking increased inflation. Mexico's gross domestic product -- the sum of a nation's output of goods and services, not including foreign earnings -- is expected to shrink by 4 to 5 percent this year.

The IMF's endorsement of growth-oriented economic policies is being presented by officials here as a radical departure from the austerity programs required of Mexico and other countries in the past as a condition for IMF assistance. Some foreign bankers, however, stress that unless the IMF agreement is viewed by creditors as requiring increased fiscal conservatism, it may not produce further private lending to Mexico.

"The ideal is to have an IMF plan that is different enough for the Mexicans to be able to present it at home as a political breakthrough, but not so different that the banks will begin to worry that Mexico isn't being required to put its house in order," said a representative of a U.S. bank on the steering committee of Mexico's major creditors.

Mexico has failed to meet all its past announced IMF-monitored budget- and inflation-reduction targets -- most recently because of plunging prices for oil, which accounts for about 60 percent of Mexico's exports and a substantial share of its government revenue.

Even though the new IMF agreement will call for a large reduction in the Mexican budget deficit, pressure to pump up the economy with deficit spending will increase as the country's presidential election nears, analysts said. Cabinet officers already are jockeying for the chance to succeed President Miguel de la Madrid, who is expected to choose his party's 1988 presidential nominee within the next 18 months.

"You can't expect Mexico to tolerate continued recession in a presidential election season," a European diplomat said.

The private banks -- which expect Mexico to ask for at least $2.5 billion in new commercial loans this year and at least as much again for 1987 -- have been invited by Petricioli to a meeting Wednesday evening at Manhattan's Pierre Hotel, at which Mexican officials plan "to present and discuss with you our economic program for 1986 and 1987," a New York banker, who asked not to be named, said in a telephone interview.

The Mexican invitation was extended to a number of major money-center banks, including the 13 banks on the steering committee representing Mexico's approximately 700 private creditors. The steering committee, co-chaired by Citibank Vice President William Rhodes, will meet with Mexican negotiators Thursday, a committee source said.

Mexico's new commercial loan request was approved in principle by the steering committee, pending the signing of an IMF accord, banking sources said. But many smaller U.S. regional banks and, reportedly, some Japanese and European banks are resisting the pressure to increase their exposure in Mexico, the sources said.

Negotiating a new loan pact with Mexico's private creditors could take two months or longer "even if no one has any substantial objections," one steering committee banker estimated.

The Mexican government may need a fresh credit infusion before that if it is to keep current on its foreign interest payments, which average about $600 million monthly, some bankers believe. Mexico's liquid foreign reserves are estimated at between $2 billion and $2.5 billion, about half the amount of Mexico's hard-currency holdings one year ago.

In addition, according to local press reports, Mexico is seeking a commitment now from private banks to lend more fresh money in 1988 and 1989 if Mexico remains in compliance with the terms of its IMF accord. Mexican officials also are expected to present a plan for a further renegotiation of what is now approximately $50 billion in commercially contracted government debt.

Bankers said they will be asked to slash the interest rate on the restructured debt, which under the terms of Mexico's last rescheduling accord a year ago was slated to rise from seven-eighths of a percentage point above the London interbank rate this year to 1 1/8 percentage points over LIBOR in 1987. LIBOR is the benchmark rate for international loans.

Another concession expected from bankers is a further postponement of a $950 million principal payment originally due last April and delayed then until October.

Discarded, apparently, are Mexican suggestions that banks either roll over interest payments as new long-term loans or peg rescheduled debts to radically concessionary interest rates.

The Wednesday meeting with Mexico's commercial bankers will be Petricioli's first since his appointment last month. He is expected to be accompanied by officials from the IMF, the World Bank and the Inter-American Development Bank, who will outline the new financing planned by multilateral lenders to Mexico, the banking source said.

The World Bank expects to approve nearly $1 billion in new loans to Mexico this year, Mexican and World Bank officials said. Mexico hopes to save $1 billion through the rescheduling of loans owed to the Paris Club of Western government trade banks. The U.S. Commodity Credit Corp., meanwhile, reported recently that it will lend about $900 million to finance Mexican staple food imports this year.