That's comparing new cars (all EVs are fairly new) to the full range of passenger rail, including 40-year-old diesel trains trundling around Wales.
Look at "Eurostar", which is a not-even-that-new high speed electric train: 6g/km. Though the calculation probably also takes account of the number of people on the train, and Eurostar will have better utilisation than average.
(NB coal and ore is moved at about 60mph in the UK, to avoid slowing other trains.)
the problem is that cars have a much worse form of overhead: parking. A rail line that transfers 1M people's commutes per day doesn't use up any space in the city that people commute to. If the same 1M people commute by car, you end up needing roughly 15 square kilometers just for the parking.