Modi was accompanied by Premier of Kwazulu Natal during the train journey. Modi boarded the train in memory of the 1893 incident in which Mahatma Gandhi was thrown out of a train compartment on account of his skin colour.
After arrving at the Pietermaritzburg railway station, Modi spoke to mediapersons and said: "My trip to South Africa has become a sort of a pilgrimage. I am talking to you from the place where a lawyer named Mohandas in 1893 was thrown from a train."
"I am fortunate that I got to visit a place where a man's journey had ended and a Mahatma's journey began," he added.
Modi arrived in Durban on Friday night from Johannesburg on his third day in South Africa.
Following the train journey, the Indian prime minister will be visiting Gandhi's Phoenix Settlement.
A grand reception will be held in Durban hosted by the Mayor of Durban and the Indian High Commissioner to South Africa before Modi leaves for Tanzania.