That is also ignoring the fact that you can't just take the entire GDP growth and use it to pay the loan, you have to collect fares and taxes which can only be a proportion of that growth. If you collect more in fares than the increase in GDP, you're leaving the country poorer than they would be without the railway.
Djibouti is going to need to see some pretty big additional growth from the railway to make the project worthwhile. Not to say they won't, be it's easy to underestimate just how big of a debt burden it is for a small country.
The train system presumably generates revenue, where the operating income can be used to pay off the debt, rather than paid by tax on the GDP. A train system has transformative benefits to a nation. The benefits are still there long after the debt is gone. The ROI period is way longer than 30 years.
What if (as seems likely) the monotonic growth doesn't materialize? What if there's a recession for a few years and there is a decline?
Taking on debt means taking on risk.
I don't much about the geopolitics or stability of these two countries, but assuming they aren't too unstable, it's hard to imagine that increasing mobility and ease of commerce won't have a sizeable economic boost.
> The loan is worth 475 million USD at the rate of Libor 6 months (0.507%) plus 2.6% with a 3 year grace period and 23 year maturity