Mexico, which touched off the Latin American debt crisis in 1982, yesterday signed a preliminary agreement with the International Monetary Fund on a 1985 economic program that calls for continued efforts by Mexico to reduce its inflation rate and budget deficit.

In return, Mexico will be permitted to borrow the final one-third of a $3.6 billion IMF loan negotiated in 1983 and to sign an important accord with its bank lenders that stretches repayment of $50 billion in bank debt over 14 years.

But Mexico stands in economic contrast to other major Latin American debtor nations, with the possible exception of oil-rich Venezuela. Three months after Argentina's decision to adopt an IMF program triggered overly optimistic reports in many quarters that the debt bomb had been defused, Latin America's debt crisis has reappeared.

"It never went away," said one key international banker. "It amazes me that the press and others can swing from despair to euphoria and back again."

Brazil and Argentina have been cut off by the IMF because they have fallen far out of compliance with the economic programs they agreed to -- in Argentina's case only three months ago. Chile has taken all the steps mandated by the IMF, but its economy continues to worsen because of depressed copper prices.

Peru and Bolivia have such serious economic and political problems that bankers and international financial officials are beginning to question whether they ever will recover.

The austerity measures that nearly all countries must take to reduce inflation and the need to borrow hit hard at workers and poor people: The easiest way to cut spending is to hold down wages and eliminate subsidies on basic foodstuffs, gasoline and transportation.

Bankers and international financial officials continue to be heartened by Mexico and say they hope other nations will develop the political will to take the steps they agree to in IMF programs. Mexico took the medicine and is rebounding. Other big countries have not -- and are stumbling, mainly on raging inflation. Copper-dependent Chile must be viewed in a different light than Mexico, Brazil, Argentina and Venezuela, they say.

"Mexico is a rock," according to an executive of one major international bank. "Whatever other countries do, Mexico continues to try to work itself out of its economic problems. It didn't have the resounding success last year that it did in 1983, but inflation and economic growth still improved."

Even Mexico had some difficulties hammering out an agreement with the IMF for 1985 because it failed to meet all its targets. But unlike Argentina and Brazil, Mexico moved toward its targets rather than away from them.

On Friday, Mexico and its bank lenders will sign a long-term refinancing accord that will spread repayment of about $50 billion in debts over 14 years. By signing a multiyear pact that pushes off repayment of most of the principal for seven years, banks hope to allow Mexico to devote more of its resources to growth and less to debt service.

Mexico owes nearly $100 billion to foreigners -- commercial banks, foreign governments and international institutions. It ranks just behind Brazil, which is the developing world's biggest debtor country with slightly more than $100 billion in debts.

Bankers and debtors alike had hoped that the Mexican agreement would be a model for other debtor nations. So far, however, only Venezuela -- with $35 billion in foreign debts -- has been able to reach a tentative accord on a long-term debt rescheduling with its bank lenders. And Venezuela, with its large oil revenue, hasn't borrowed from banks or the IMF since the debt crisis began 31 months ago.

The IMF had winked at Brazil's failure to take internal anti-inflation steps because it was running up a huge trade surplus that generated the dollars it needed to pay its foreign debts. But after a year of promising to do better, the lame-duck military government permitted such rapid money and inflation growth in December that the IMF felt compelled to call the country on the carpet.

Analysts said that the military government -- which handed over the reins to civilians March 15 -- spent so much money in December that the IMF no longer could ignore Brazil's inability to cope with inflation.

Brazil and Argentina will not receive any more funds from the IMF until they adopt an economic program acceptable to the international agency. Presumably, the IMF will demand evidence that the two countries are prepared to take the steps they say they will take.

Raul Alfonsin took over late in 1983 as Argentina's first democratically elected president in eight years. But solving the country's economic and debt problems involved a belt-tightening that he was not willing to undertake.

By last fall, inflation had spiralled out of control. Argentina finally signed an accord with the IMF that the agency approved in late December. But the agency, sensing that the country was not taking strong enough medicine, last week cut Argentina off until a new program is developed.

That threw a monkey wrench into arrangements for the $4.2 billion loan that the cash-starved nation had negotiated last December with an advisory committee of its 11 biggest lenders. Getting all of Argentina's 320 worldwide lenders to agree had been difficult, but by last week nearly all had assented. Bankers will not disburse funds when a country falls out of IMF compliance, and some key bankers are worried that reluctant participants in the loan will use the IMF action as a reason to back out.

But no matter what sort of difficulties Mexico, Brazil, Venezuela and Argentina face, they all possess economies that are big enough to survive the crisis -- although there will be difficult times ahead at least for Argentina and Brazil and, because of the shocks a default by either would generate, months more of worry by international financial executives.

But bankers and others are worried that Peru and Bolivia never will resolve their difficulties and that Chile -- whose right-wing military government is being pressured both at home and abroad -- could face a collapse as well.

For all practical purposes, Bolivia is in default. But it has been a basket case for so long and its debts so small that many banks already have prepared themselves for an eventual write-off of Bolivian loans, and some already have done so.

Even Peru, which owes foreigners $14 billion, and Chile, with foreign debts of between $18 billion and $20 billion, are unlikely to undermine the world financial system seriously if they stop paying their debts.

But bankers said they worry about the precedents that a Chilean default would set. "Unlike Peru, which has never taken steps to reduce its budget deficit, Chile has been austere," said one banker. Chile has "outfunded the International Monetary Fund," said another. Low copper prices have so devastated Chile that the country calculates it will need $1 billion from its bank lenders this year -- a level banks said is too high for them to lend prudently.

One key banker said the United States has to realize that Peru and Bolivia -- and probably Chile -- cannot solve their debt crises solely by dealing with the IMF and the commercial banks. They need a different kind of official assistance, the banker said.

However, he agreed that, if the United States comes to their aid, it would be hard-pressed to refuse the bigger debtors such as Mexico, Brazil and Argentina.