Gas and diesel have relatively short shelf lives.
They last around 12 months (way less for gas with added ethanol) if stored properly meaning not too cold or hot and no big temperature changes.
This can be extended with preservatives/stabilizers to a few years but after that you are fucked if you don’t run a refinery.
So yeah preppers should go with electric. Batteries also have a limited lifespan but it should be longer if managed properly.