The agreement marks a rare bright spot in the two countries’ bilateral relations, which are complicated by as many as 500,000 Rohingyas living in Bangladesh after fleeing decades of persecution in Myanmar.