Well, I mean, lets reflect on the options. If they go through the building in any way then they'll be putting the hostages in the way of the robots. Even if they manage to beat the robots, they still would have put the hostages directly into the line of fire of the enemy. By taking the elevator they're sitting ducks and would still have to deal with robots on the ground floor. Plus when they leave the building there will be robots on the street. By taking the roofs, they're keeping the hostages as far away as possible from the robots.