Cars don't work in dense places.

Sure but most of the world has a density low enough that cars work and trains don't really. I like trains as much as the next nerd, but you're never going to be able to take a train from your house to your local farm shop or whatever.

Where trains work they are great. Where they don't, driverless electric cars seem like a great option.