Yes (but it was in Uitenhage, near Port Elizabeth, which is 700 km from Cape Town).
There's a detailed story about that here: Jack the Signalman
by Pieter du Plessis ©.
The background details in the story should help you decide whether to believe it.
It includes the following which says that he did "work for the railroad":
Jack has passed his test with flying colours and were duly employed by the authorities and from that day became known as Jack the Signalman. Bot not only did he get his monthly rations from the government but he also received an employment number.
The story doesn't provide physical evidence or eye-witness reports, but suggests where some might be found: it ends with,
During 1890 Jack got sick and contracted tuberculosis and died, Wide was inconsolable to the loss of his friend as they were inseparable. Jack’s skull is on display in the Albany Museum in Grahamstown and a photographic museum were established at the old Uitenhage station that can be visited on Tuesdays, Wednesdays and Thursdays only.
This blog entry appears to be a visitor's account of their visit to old Uitenhage station. It has a section on Jack the signalman, and includes several photographs showing Jack and his master.
This link is to an article in The Telegraph dated November 11, 1990. It repeats (confirms) the story of Jack, and says that the original story of Jack was published in "Nature, the science journal", in its July 24, 1890 issue. It says that Nature has just published a correction to that story (perhaps a record-breaking correction, being 100 years later): the correction being that Jack worked in Uitenhage in the Cape, not in Natal as Nature had originally reported.
Baboons are somewhat trainable (as shown for example in this Baboon Training Pt. 2 video on Youtube, and this story titled ZOO ANIMALS
Baboons Can Recognize Words, so the story isn't completely impossible.