The coalition government is aiming to rehabilitate KiwiRail with a $1 billion investment over the next two years.
The government said that following privatisation, KiwiRail went into a 'managed decline' and Budget 2019 aims to rebuild it.
This includes $375m for new wagons and locomotives, $331m to invest in track and other supporting infrastructure, and $35m to begin the process of replacing the current Interislander ferries that are nearing the end of their lives.
The package also includes $300m from the Provincial Growth Fund allocated for investment in regional rail initiatives.
Deputy Prime Minister and Minister for State Owned Enterprises Winston Peters said rail services were a critical and valued part of New Zealand's transport network.
"This funding will enable KiwiRail to become resilient and reliable through substantial investment in rail infrastructure, purchasing new locomotives and wagons, and beginning the process to replace the Interislander ferries.
"After 155 years of rail in New Zealand, the historic misstep of privatisation and the managed decline of the past decade, securing these assets for the future is especially gratifying," he said.
Transport Minister Phil Twyford said it was the first step towards rebranding rail as "the backbone of a sustainable 21st-century transport network."
"Rail makes a vital contribution to urban public transport. Moving more freight by rail is economically efficient, and reduces carbon emissions as well as deaths and serious injuries on our roads," Mr Twyford said.
"Previous governments have taken a hands-off approach and left rail in a state of managed decline," he said.
The Budget also provides $405.5m toward the Auckland City Rail Link.