Not all of the tax money on gasoline goes directly to road maintenance I would guess, it also goes to environmental cleanup projects I believe. Also, remember that EV's are not as heavy in all cases. My 3 SR+ weighs just 3627 lb
Also note that here in CA if the car costs more the registration fee for the EV is more than $100 so I think that helps make up for the difference as well.