Both are grammatical. Depending on the specific sentence, bringing the infinitive clause to the front for the sake of emphasis could be awkward. It is a stylistic decision that departs from standard conversational word order and therefore changes the register.
In your specific case, bringing it forward would also need you to take care that other phrases were not colloquial but in the same register, if you wished to avoid a "register clash":
Many people in Athens were able to save themselves from the fire but to save their children they
didn't have any timehad no time.