Exactly. At the current rate of usage, we have fossil fuels to last for at least the next 200 years. And remember that there are a lot of regions which are yet to be explored for petroleum (such as the Arctic and the Antarctic). But personally, I believe that we may not need to use fossil fuels for that long. Electric vehicles will replace the gasoline driven ones within a few years time.
Stone Age didn't end for the lack of stones
On the other hand, if most cars with internal combustion engine get replaced with electric cars eventually, wouldn't that require burning the same fossil fuels (natural gas, before all) at power plants to produce all this huge volume of electric energy required for these cars? Nuclear power plants seem to be not very welcomed across the world (save for China, Russia and maybe a few other countries) while commercial fusion power stations are still a thing of a far too distant future. Producing electric batteries themselves also requires heaps of energy, if I'm not mistaken
Perhaps in some areas this is true, however electricity is more efficient in an emissions comparison to oil, even if the electricity comes from fossil fuels. The production of the batteries is a separate issue (may very well create different environmental harm; not just emissions, but lithium production, etc.), but switching to electric vehicles would greatly reduce the CO2 emissions, and further the transition of electricity generation from fossil fuels to cleaner sources.
Petroleum in the long run will no longer be in demand. The demand will fall and why is it, you are right in saying that electricity, solar power, water as fuel are beginning to emerge. If you notice arab countries that supplies oil are now preparing for the fall of petroleum business they are establishing alternative business today when oil is still in demand. But to invest in oil today is still good because the fall on oil demand will not happen so soon since big persons in the government who are stockholders of oil will not allow oil to be washed away in the market.