The two Sri Lankans have been rescued and are unharmed, the Sri Lankan mission in Dhaka has confirmed to media.
Meanwhile, according to the BBC, Bangladeshi troops have said they have cleared the cafe where the incident had taken place.
The militant group Islamic State (IS) has said it carried out the attack.