KiwiRail has made a net loss of $33.7 million in the six months to December, which was an improvement on a year earlier loss of $104.6m.
The state-owned business said revenue also improved slightly to $333.6m.
The company said it was a solid first-half result considering an economic downturn in multiple markets, along with natural events that damaged the network.
"Despite these challenges, we saw our import/export business grow by 5 percent compared to the previous half year," KiwiRail Group chief executive Greg Miller said.
"We're making good progress, but we are still dealing with the results of many years of underinvestment that has limited our ability to continue to provide the services our customers need, and to realise the full potential and value of rail."
He said the outlook for the rest of the year was uncertain given the potential effects of the Covid-19 coronavirus on the wider economy.