It’s not about “dominating”, it’s about making it in the business interest of the common people that the railways operate unmolested, economically, politically, and legally.
Also if the most profitable railways are funded by locals and more strategic railways are funded by China to connect the profitable lines on an east west alignment a trans-African line could be built from Senegal to Nigeria and on to Ethiopia and the port in Djibouti. China could restrict which companies ship over the lines they own/control under a BOT agreement and therefore earn back the investment through shipping charges; cheaper then truck based shipping. Chinese owned lines could also incentivize Chinese mining companies to operate in more parts of Africa.
For example a more modern Chinese build railway could easily outcompete the existing Dakar-Niger railway that in places has to run at only 20 kmph . In fact African countries have looked to China and the CRCC in 2015 to modernize this particular line.