I mean, all their menfolk are dead. Unless they have more people who are able to stand in the phalanx, they have no hope. Yeah it will take a while, but eventually the money, and the grain, will run out. Then its only a matter of time until they either starve, eat each other, or fall on their own swords.
Mass suicide in these hopeless situations was a thing in ancient times, because mercy was neither given nor expected. Yes, if they think there is no hope then the people who will fight will fall upon those who cannot and kill them, before turning their swords upon themselves.
And yet history is full of examples of cities withstanding sieges or similar circumstances, especially against barbarians. Because all it takes is a single disease outbreak or internal dispute and the besieging force go away/are satisfied with tribute. After all despite being so terribly weakened the city has been said and shown to capable of withstanding a siege for several years..