US president praises leaders of South Asian rivals for reaching ceasefire without which ‘millions of good and innocent people could have died’