This happened a while ago (in-game; a few days ago real time) so I'm afraid I don't have a savegame or debug.err.
I had a fortress with 7 trained groups in it when Magnar declared war on me. He moved 20 stacks against that fortress in a single turn. When the first stack attacked, my trained units had a couple of city militia and city archer groups with them. I defended the city, and noticed the city groups leveled. When the battle for the second stack started, the city groups were nowhere to be found. Had they buggered off to a pub to celebrate their new levels?
My trained groups held out through 9 waves before my melee groups fell, then I hit "Auto-resolve" for a couple more before my archers went down, too. No city groups showed up to help, at least in the battles I fought myself.
A turn or two later, after a champion-led (Tuatha and Ritressa) group got there and reclaimed the fortress, Magnar's remaining stacks tried again. The same thing happened - city militia and archers helped in the first battle (and leveled), but not the subsequent ones. (I held on this time, but Ritressa took a beating. Several of them, actually.)
This seems like a bug, to me. Is it one? I really could have use city defenders in that first go-round.