Brazil has reached a tentative new agreement with the International Monetary Fund that should open the way later this year to renewed lending by the IMF and international bankers to the cash-starved nation, Brazilian Finance Minister Ernane Galveas said yesterday.

A team of IMF officials that has been in Brazil negotiating the details of the package is returning to Washington to present the agreement to IMF Managing Director Jacques de Larosiere. If he approves it, the plan will go to the board of executive directors for a final decision in October, sources said.

Galveas told reporters he hoped the IMF would encourage commercial banks to resume their lending before then, by the end of September.

Brazil, which owes close to $90 billion overseas, has been hovering on the edge of bankruptcy all year. It is more than $1.5 billion behind on its foreign payments to banks and suppliers, sources say. These arrears will climb to more than $2 billion by the end of September, if the nation gets no new money between now and then, and to almost $2.5 billion by year-end, according to estimates being made in Brazil.

The nation's cash squeeze became more acute after the end of May, when the IMF stopped paying installments on a three-year $4.9 billion loan because Brazil failed to stick to tough economic conditions. Since then, Brazil has been locked in negotiations with the IMF on a new loan agreement.

Commercial bankers, who were already uneasy about Brazil's financial and economic package, stopped paying out on a medium-term loan for $4.4 billion once Brazil fell out of compliance with the IMF program.

Last month, the Brazilian government finally agreed to IMF demands for a modification in the wage and salary laws that previously compensated workers fully for inflation--now running at close to 150 percent a year.

But the military government's backing for a change in these laws, which would lead to real wage cuts because wages would no longer keep up fully with price increases, came against a backdrop of rising opposition to the economic austerity.

The change in the law has to go through the Brazilian congress, which can choose not to vote on it. If that happens, the decree would automatically become law but only after a delay of 60 days. The IMF likely would not consider the new agreement until it has been cleared through congress, monetary sources say.

Strong political opposition to further painful economic measures delayed the government's agreement to other IMF demands for further spending cuts and anti-inflation measures, and yesterday opposition members of congress demanded the whole IMF agreement be presented to congress for ratification. There have been growing demands in Brazil for a moratorium on debt repayments.

Meanwhile, de Larosiere has been tougher about the new package after the failure of the first one, sources said. A senior Washington official commented that "when things become undone" once, "then you want actions rather than promises of actions" the next time.

A New York banker close to the Brazilians said recently "the managing director of the IMF is taking a lot of time making sure that it's OK this time."

Although de Larosiere has not yet given his official blessing to the new agreement, sources said the IMF team in Brazil would have had clear instructions about what was acceptable and would be unlikely to return with a deal that fell short of the minimum requirements.

However, one report from Brazil yesterday said the IMF had given way to Brazil on one sticking point, this year's projected inflation rate.

Private bankers already have begun work on a complete overhaul of their loan agreement with Brazil. The complicated first phase was a failure almost from the start, as regional banks in the United States and elsewhere did not come up with their share of the money promised to Brazil.

The second phase of the commercial bank restructuring, being coordinated by Citibank, will be aimed at providing all the bank finance that Brazil needs through December 1984, banking sources say.

The nation is asking for a further $3 billion to $4 billion from international bankers for the rest of this year and for as much as $5 billion of new money for 1984, sources say.