It is certainly a good idea. The loan can be spent on irrigation projects, building public transport infrastructure, free/subsidized housing, and also power generation that can be owned privately ( like how SolarCity is doing ) or communally ( perhaps neighborhood-maintained.
@Hamartia Antidote had once posted about an American truck-portable experimental fusion electric generator ).
On the other hand you mention 50 years as the loan period. Well, I believe that in 15 to 18 years time, humanity will be mining minerals from the Asteroid Belt, so Pakistan has to offer to China ( or Japan ) something not available in The Belt. Or Pakistan has to offer some service to China ( or Japan ) that they don't have or have less of. Like how India is doing with IT and agriculture.