To be fair, this was negotiated during kibakis time. Kenyatta did the financial negotiation.
As far as I recall, the only thing Kibaki's government signed was an MoU (non-binding). Uhuru did not have to go through with it, if it made no financial sense, which they had been told---by the World Bank, the EAC's own independent consultants, etc. And having decided to go through with it, they did not have to include some padding for the eating.
Another factor that is yet to be discussed is that chances of the line not being a total economic failure are dependent on calculations assuming cargo all the way to Uganda and Rwanda. When does the line get extended past Nairobi, and at what cost?