If you can do those two things and rescue the hostages then bravo. If not then you don't want to forget your first two goals.
It isn't TV where the brave FBI agent lays down his gun and then pulls a Jackie Chan maneuver to capture the bad guy and retrieve the hostage without a scratch.
In reality you shoot through the hostage if you have to but the terrorists are not walking out.
If any of them walk away you are going to have to deal with it again and again and again.
If they all die then it will be awhile before someone tries that again.
Yes, that’s pretty realistic. But folks are used to episodes of crime shows where all the innocents walk out alive.