The head of State and other passengers found himself stuck on a commuter train for several hours, giving him a first-hand experience into the daily reality for thousands of commuters just two months ahead of the May polls.
Ramaphosa was stuck on the train for three hours on a journey from Mabopane to Pretoria that should ordinarily have taken just 45 minutes.
"It is unacceptable," President Ramaphosa said after the train reached its destination.
After his ordeal, Ramaphosa warned that the national rail operator, Passenger Rail Agency of South Africa (Prasa), had to act to improve the situation "otherwise heads will roll".
“It is unacceptable that a trip of 50km (30 miles) can take us three hours and it must come to an end. We are going to talk to Prasa to get things right or otherwise heads must roll,” Ramaphosa said.
Prasa is the national rail agency.
The delay to the train the president caught in Gauteng Province was caused by another train that had to stop after its driver was hit by a stone which had been thrown at him, a Prasa spokesman said.
Train delays are, however, a common occurrence in South Africa where millions of South Africa's railway users and some have lost jobs because of late arrivals at work, according to BBC's Milton Nkosi in Johannesburg.
Angered commuters have even set trains alight.