For any given vehicle & load -- roadster, locomotive, or anything in between -- the per-mile cost of electricity is about half the per-mile cost of gasoline. The main reason for that is the ~70% efficiency of an electric powertrain, compared with the 7% typical of an automotive gasoline engine.
The lifetime of traction batteries is considerably greater than the lifetime of starting-lighting-ignition batteries because they're much more carefully charged, discharged and balanced. Remarkably sophisticated algorithms monitor & control their use, and thermal management is often included.