Electric vehicles generally have a higher purchase price. But EVs beat out gasoline-powered counterparts on total lifetime costs in certain cases.