RIO DE JANEIRO — Brazil was still mourning the victims of one of its most agonizing sports tragedies, the crash of a plane carrying the Chapecoense soccer team. But the country’s scandal-plagued Congress had its own priorities: gutting what was supposed to be a pioneering anticorruption bill.

Shortly after President Michel Temer declared three days of official mourning for the victims of the crash, Brazilian legislators held a marathon session that went into early Wednesday. The result: legislation that could significantly erode the authority of prosecutors and judges who are investigating politicians in corruption cases.

“It was disrespectful to have voted on this on a day of mourning,” said Andrew Moreira do Nascimento, 28, the co-owner of a restaurant in São Paulo. “The focus was completely off them because of Chapecoense, and they took advantage. We’re represented by people whose own interests are their main concern.”

Many members of Brazil’s lower house are facing graft cases of their own. By watering down the anticorruption bill, they not only stirred the anger of their constituents but also set up a clash with the judiciary, heightening tensions among branches of the federal government.