yea, the Big T is coming for the capitol... line the wall with archers and they all open fire as soon as they see it... someone find a staples button... "Wow that was easy"
I dont have my books with me atm, but I think my point stands without it. Bearing that in mind:
Let's say the city guards are, in fact, using the Guard template. Assuming 1% of the people in a city of 25,000 are guards (which is a lot), and the rest are commoners, that's a force of 250 troops. Give them whatever bows they can find (assume light crossbows with range 320 for ease of calculations), and they'll have +3 to hit (+1 Dex + prof), against the Tarrasque's AC 25. Using the group combat rules from the DMG, each individual would require a 22 to hit... Since a mob requiring 19 to hit only hits once every 10 attacks, and a mob requiring a 20 to hit only hits once every 20 attacks, let's extrapolate that so that a 21 would require 30 enemies, and a 22 would require 40 attacks to hit once.
That gives us, of this force of 250 guards, 6 hits per round against big T. Factoring in their disadvantage for long range, and we can assume that, with their odds of 1 in 400 to hit, that outside of the 80ft range, nothing would hit accurately enough to damage the Tarrasque. Within the 80ft range, they'd have 1 turn to damage big T before it reaches the walls. Once it reaches the walls, it's game over for the city: the gates would be demolished, the walls obliterated, and soon the rest of the city would follow.
So how much damage would those archers do? Saying they get 2 turns of attacks, one before and one after big T gets into the walls. Hell, let's even be nice and say that they manage to avoid being killed by the wall being taken out from under them and all succeed on their saves, so the full contingent of 250 is firing. The guards would manage 12 attacks for 1d8+1 each, for a total of 66 damage. But wait! The Tarrasque resists damage from non-magic weapons, so they only do half that! Altogether, the Tarrasque takes 33 points of damage, the city is destroyed, and everybody dies. Good job guards, you sure showed him who's boss...
EDIT: Turns out the tarrasque is
immune to damage from non-magical weapons. So even if the whole population of 25,000 were all soldiers, they'd be demolished without it taking a scratch.