Why can't a car run on electric and have a onboard generator ,

the same way the trains do ,, use electric and with gas generators

by doing this you wouldn't need to change the intrastructure for gas

and have unlimited milage and with the batteries low polution

on short trips

just curious