One of the problems with the power grid in third would communities is the need to constantly import coal, oil, and gas to run the power plants. And constantly import oil to run vehicles as well. So it's not like they aren't spending money already. And solar + electrified transport is cheaper then what they have now.
Electric cars are fundamentally better because developing country could just use some of the excise tax they charge on cars to buy solar panels. And the power from solar isn't subject to price shocks and interruptions like oil and gas are.