How could it be a flat battery if the engine was being cranked?
Perhaps you flattened the battery by repeatedly trying to start the car – and it was flat by the time the AA man arrived – but that was not the reason it would not start initially.
The problem could be the CPU (the car’s computer system), or it might be something as simple a damp effecting the vehicle electrics. Although the car will not be using a high tension spark distribution system; damp starting problems are much reduced from years gone by.
Nevertheless it would be worth giving all electrical wiring under the bonnet a spray with WD40 (or similar) – but make sure you keep the spray well away from any timing belts that might be exposed.
The next time this happens, rather than continually cranking the engine, flattening the battery, switch the ignition off for a couple of minutes to give the CPU time to reset its brain.
I would also have the spark plug gaps checked, which could cause this issue if incorrect.