Brazil's Congress late Wednesday handed the nation's military leadership a major defeat in its attempt to hold down wage increases, a defeat that may make it harder for Brazil's government to persuade the International Monetary Fund and major international banks to resume lending to the financially distressed country.

Although the 252-1 vote was on a bill that no longer is essential to the government's economic austerity program, sources in Brazil said it is an indication that an even tougher government wage-control measure that is part of its latest economic package also may be rejected next month.

The IMF and Brazil, after months of negotiations, finally agreed earlier this month on a new set of economic goals that Brazil has agreed to meet in order to reduce its need to borrow from abroad. Because Brazil--with foreign debts of $90 billion--fell seriously out of compliance with the initial agreement reached Feb. 28, both the IMF and international banks stopped lending new money to the country May 31.

Brazil is so strapped for cash that it is about $2.5 billion behind on its interest payments to bankers and is husbanding its meager dollar inflows to buy oil and pay what it can on its foreign interest arrears.

While the military leadership can force the measure, or something similar, on the country, the widespread opposition calls into question whether Brazil can give any lasting guarantee that it can fulfill a key part of its austerity pledge to the IMF: that the government would take steps to reduce inflation from today's 150 percent annual rate to 55 percent by the end of 1984.

Although an attempt to call a general strike to protest government austerity measures failed last July, labor leaders said yesterday that workers are now uniting in opposition to wage restrictions and the IMF agreement.

The government measure that Brazil's Congress is expected to reject next month would hold wage increases to only 80 percent of the inflation rate (compared with today's 100 percent indexation). The measure rejected Wednesday would have exempted lower-wage workers from the 80 percent restriction.

Brazilian opposition leaders have called for a moratorium on repayment of foreign debts, although Brazil already has declared a de facto moratorium by permitting its interest payments to fall behind. Brazil has not paid any principal in months, while banks have permitted the country to fall into arrears without taking steps to force it into default.

A formal declaration of a moratorium is considered unacceptable by the Brazilian government because the nation would not only be cut off from new money as it is now, but likely would have trouble getting the trade financing it needs to export and import essential items like oil. But observers worry that internal politics might force Brazil's leadership into such a posture.

Meanwhile, Mexico announced yesterday it will repay by mid-December $560 million in back interest its private companies owe foreign bankers. Because Mexico did not have enough dollars to pay interest on both its public and private debts between August 1982 and January 1983, companies made peso deposits in the Mexican central bank in lieu of paying dollars to foreign banks.

Mexico said it will convert half those peso deposits into dollars to repay the banks Sept. 30 and would convert the rest by Dec. 15.

Mexico also announced late yesterday that it will devalue its peso gradually, at the rate of 13 centavos a day. Over a year that would result in a 32 percent devaluation. The peso now is pegged at 149.1 to the dollar. The move should help Mexico's balance of payments, but also will hurt inflation by raising import prices.