> if you can build batteries with the energy density of gasoline
Actually significantly worse than that. A plane gets lighter the longer it flies, especially at takeoff when everything is at max thrust. A battery becomes more and more dead weight the longer you fly.