RIO DE JANEIRO — The battle over Brazil’s newfound oil riches is heating up.

The lower house of Congress voted last week to share the portion of the country’s royalties from oil revenues that go to Brazil’s states equally among the states. The vote, part of a broad overhaul of the nation’s oil laws being undertaken in the wake of big offshore discoveries over the last three years, was a shocking blow to the state government of Rio de Janeiro, Brazil’s biggest oil-producing region.

If the bill becomes law, it would deny the state of Rio and other oil-producing states billions of dollars in expected royalties. Rio’s annual oil revenue would fall to about $134 million from about $4.3 billion, state officials said.

But Rio’s governor, Sérgio Cabral, is fighting back, calling the vote in Congress a “lynching” and contending that it was unconstitutional. He said promised public works projects for the 2014 soccer World Cup and the 2016 Olympics in Rio could be imperiled by a sudden drop in revenues, although the federal government has pledged to back Rio’s Olympic effort.

Mr. Cabral, an ally of President Luiz Inácio Lula da Silva, organized a large march through Rio’s streets on Wednesday afternoon to protest the move by Congress. Despite a persistent rain, tens of thousands of people, many of them state employees who had been given the day off, showed up, with many arriving on buses from all over the state.