Kenya, like many other African countries, has railways that were built in colonial times and often since the end of World War 2 they were only receiving basic maintenance. Things have changed in Eastern Africa with Chinese investments - Asian corporations invested in railroad transport to transfer the resources, but the investments usually ended where the resources were available.
Kenyan trains has often 1950s to 1970s locomotives and as it is popular in third world countries people travel inside as well as on the top of the trains.