South Africa's Phelophepa train draws a crowd wherever it goes.

The sound of the lumbering 19-car clinic-on-rails signals the arrival of badly needed free healthcare for thousands of South Africans as it tours the country.

"When you arrive, people are always ready, there will be kids performing," said train manager Anna Mokwena, a nurse.

At a stop this week in Pienaarsrivier, a town in South Africa's impoverished Limpopo province, dozens of elderly patients alongside women clutching children flocked to take advantage of the service.

"We are so happy. I got two pairs of spectacles and now I'm going to see the doctor for a checkup," said 60-year-old Janette Rakgetse from nearby Hammanskraal.

"I've saved a lot of money. We arrived at 5am to beat the queue. We are a group of grannies who organised ourselves to come here."

The train clinic will spend a fortnight alongside Pienaarsrivier's neat red-brick station, 55 kilometres north of the capital, Pretoria, before travelling 500 kilometres to Ladysmith in the country's east.

It will provide access to general medicine, dentistry, psychology services, a fully stocked pharmacy and an eye clinic.

Final-year medical students at universities across South Africa help up to 400 patients a day.

They will typically spend a fortnight onboard before swapping with a fresh team of interns.

Run by Transnet, the state-owned rail logistics operator, the train has rotating crews of students who work with a permanent team.

In 2014 Transnet supplemented the first Phelophepa train, which started as a modest three-coach setup in 1994 but now has 19 carriages as well, with a second one at a cost of 80 million rand ($6.2m) for the coaches alone.

The name means "Good, clean health" in South Africa's Tswana and Sotho dialects.

More than 24 million patients have been treated by the services, dubbed the "trains of hope", since their launch in 1994, making it the world's largest mobile clinic.

Patients are typically charged 30 rand ($2.30) for a pair of glasses, 10 rand for dental work and five rand for prescription medicines.

The train also creates jobs wherever it stops, employing a small army of cleaners, porters and security officers for the duration of its stay.

The two trains spend nine months a year criss-crossing the country, reaching some of South Africa's most neglected communities.