China is to finance 90% of the first stage, put at $3.8bn (£2.3bn), with work carried out by a Chinese firm.
Construction work on the standard gauge line is expected to start in October this year, and the 610km (380-mile) stretch from the coast to Nairobi is due to be finished in early 2018.