Kaikoura is served by the Main North Line, the northern section of the South Island Main Trunk Railway. Due to the hilly terrain north and south of the township, the railway only opened to the town on 15 December 1945, seventy years after a line to the town was originally planned.
Kaikoura is served by the TranzCoastal long-distance passenger train, which connects the town with Christchurch to the south, and Picton and the Cook Strait ferries to the north. Kaikoura Station was the last station in New Zealand to have a refreshment room for passengers, which closed in 1988 when the Coastal Pacific Express (former name for the TranzCoastal) introduced on-board refreshments.
Freight trains also pass through the town, mainly carrying freight between the marshalling yards at Middleton in Christchurch and the Interislander rail ferries at Picton.