The brutalist headquarters of South America's biggest company, Petrobras, offers a harsh riposte to those who try to romanticise Brazil as a land of golden beaches and endless forest. This week, the concrete edifice in central Rio de Janeiro was the focus of a pro-oil rally by thousands of petrochemical workers amid a presidential election debate dominated by how to manage the nation's vast fossil fuel reserves.

It is a question that has opened up the biggest gap between President Dilma Rousseff, an old industry champion of the Workers Party, and her main challenger Marina Silva, a former environment minister who has pledged to shift priorities towards alternatives energies like wind, solar and ethanol.

This is more than just a Brazilian rerun of George Bush and Big Oil versus Al Gore and climate concern, because state-run Petrobras is no ordinary company and – with the company also mired in a massive corruption scandal – this is no ordinary time.

On Wednesday, a former senior executive of the company, Roberto Costa, is due to testify that dozens of senior politicians received kickbacks from oil contracts as part of a scheme to buy votes. According to local media, he has already told police that big contractors with Petrobras contributed a 3% cut on contracts to campaign funds.

If his allegations are corroborated, the scale of the wrongdoing could dwarf the other major scandal of recent years – known as the Mensalão scandal – and further undermine the reputation of a company that has long been seen as a national treasure.

"The scandal is really bad. It's bigger than anything else so far, bigger than Mensalão and will play to Silva's advantage," said Heni Ozi Cukier, a professor at Fundação Getulio Vargas private university.

Petrobras is a pillar of the Brazilian economy, with production of 2.5 million barrels of oil per day, a near monopoly on petrol sales, 87,000 employees and control over the biggest oil deposits discovered in the world this century. The company's undersea drilling made Brazil self-sufficient in oil for the first time in 2006. In the following years, the company grew so fast that executives boasted they were on course to become the biggest firm in the world.

Its value has since fallen by half, but the company is as prominent as ever in the nation's life. As a state-controlled corporation, it is also a major source of funding for cultural events, hospitals and schools. Nationalist pride and defensiveness often dwell on the company – as was evident last year in the widespread public outrage that followed allegations from the US whistleblower Edward Snowden that Washington was spying on Petrobras.

"Petrobras is a strong symbol for the Brazilian people," says Edmar Almeida of the Federal University of Rio de Janeiro. "It is the largest company in the country, a success story of our engineering prowess, and a way to ensure that the nation keeps control of our oil and natural resources."

But the latest scandal has added to longstanding fears that the company is treated as a tool for politicians to reward loyalists and generate slush funds to buy off potential opponents. With the government holding more than half of the shares, senior positions in the firm have long been allocated on party lines to supporters of the government; and many of their decisions are questionable.

Petrobras lost billions of dollars on an oil refinery in Pernambuco and spent $1bn on a plant in Texas – signed off by Rousseff – that was sold on two years later at a markdown of 80%.

Oil prices have been determined by political and social concerns. Ordered by Rousseff to keep inflation down, Petrobras has been importing oil at about $100 per barrel and selling it at closer to $80. Shareholders are not happy. The stock value of the company has almost halved since its offering in 2010. Back then, it was the fourth most highly valued company in the world. Today it is 30th.

As a result, Petrobras has taken a central position in the election this year as all sides have tried to capitalise on the scandal. "I cannot imagine that people can trust a party that – for 12 years – put in place a director to raid the coffers of Petrobras," Silva said at a speech in Rio last week that called for executives to be appointed by an independent search committee.

With a manifesto championing sustainable development, Silva has promised to resurrect ethanol – which has been damaged by oil subsidies – and put more emphasis on wind and solar. Mindful of the popularity of plans to mine major "sub-salt" deposits buried deep under the floor of the ocean, she has promised to honour existing contracts and said oil will continue to play a key role in the economy. But advisors say fuel taxes will rise.

After a spectacular surge in the polls, Silva looks almost certain to be in a runoff with Rousseff for the final vote on 25 October. With the race still too close to call, the president's camp have honed in on Petrobras policy as a potential vote-loser for Silva.

Rousseff has repeatedly alleged that her rival's policies would hurt the nation's biggest asset. Her supporters claim the media attacks on Petrobras are part of an attempt to wrestle it back into private hands.

The pro-oil march this week, organised by the ruling Workers' Party, resembled rallies in Venezuela, where employees of the nationalised petrol company are bussed in to support the government.

More than 1,000 people – many of them in workers' overalls or red T-shirts – joined the demonstration, which was led by former Worker's Party president Luiz Inácio Lula da Silva.

Some chanted "Viva Petrobras! Viva Brasil!". Others carried banners declaring "Defend Sub-Salt. Defend Petrobras." Many wore T-shirts bearing the image of Rousseff as a youthful guerrilla fighter. Anti-Marina Silva badges were everywhere.

"Sustainable development sounds nice, but alternative energy can supply only a fraction of our needs," lamented union activist and Workers Party supporter Francisco de Assis. "We must not delay investment in Petrobras. Petroleum is essential for Brazil and the passport to the future for your youth. It is a source of wealth and funding for health and education".

Dirty tricks are becoming more commonplace. Some on the march claimed – without evidence – that Silva was being paid by the United States to undermine the competitiveness of Brazil's biggest company.

Others said she wanted more private investment and less of a Petrobras monopoly, though this will play badly in Rio – the headquarters of the nation's company, the stepping off point for pre-salt exploration and a key electoral battleground.

Ildo Sauer, who was gas and energy director at Petrobras under former president Lula but has since become critical of the way the company is run, believes the comparisons with the US election in 2000 are valid.

Rousseff, he says, is like Bush in her support for big companies, whereas Silva is like Gore trying to save the world. But with Brazilian coalitions even harder to build than those in Washington and Petrobras playing such a central role in the national identity, he doubts that either candidate will achieve much of a change.

"They both have almost a religious belief, a dogma about it. But I don't think they'll be able to do what they want," he said.