What happened to train travel in New Zealand?

When you travel across Aotearoa, have you noticed the train tracks everywhere? My hometown, Whanganui, has rail weaving through town. It even has a dedicated train bridge in Aramoho.
Rail runs along the far north and the deep south. A century ago, people travelled towns and cities by train. Now there are barely any trains that take people across regions. Most are tourist trains that run slowly, expensively, and infrequently.
How can a country which used to have trains taking people everywhere lose nearly all of its passenger trains in a lifetime?
Rail is the future: train travel is one of the fastest and most environmentally friendly ways to go long distances. Plus, people fucking love trains. Trains are the sexiest mode of long distance transport. The same cannot be said for buses.
We need trains connecting our regions. Fast. To revitalise rail, we need to understand the many, many failings that led to Aotearoa losing its trains. Thankfully, Dr. André Brett has explored the history of rail in Aotearoa and its demise in his book Can’t Get There From Here. I’m using his knowledge to write a two part series on rail in New Zealand; what happened to the trains, and how do we bring them back?