Thankfully, the federal government seems to be taking notice and railways are a priority for the new PAC [0] (_Programa de Aceleração do Crescimento_, or program for growth acceleration).
It's not much but it's a start.
[0] https://www.gov.br/transportes/pt-br/assuntos/noticias/2024/...
Not to mention that converting all cars to electricity will put more pressure on the electric distribution infrastructure which in itself will require more investments and will cause environmental impact invariably.
In Brazil there is a huge manufacture of sugar with excess baggasse that is used to power sugar extraction/drying and provide heat for alcohol distillation. There is a related industry of extracting leftover sugars, fermenting them, and making alcohol in rural agricultural regions, where the infrastructure for gasoline and diesel didn't exist 20-30 years ago. As a result, there is a lot of infrastructure for distributing locally produced 95% alcohol for transport (and you need to have specific gravity measured at the pump!). Unlike fertilized corn/grain alcohol from the midwest, this is not subsidized and still less expensive that gasoline in many parts of rural Brazil.