The closest modern historical analogy would be the Battle of Okinawa in which nearly 95% of the defending force was killed (roughly 100,000), and only about 5% were captured. This included teenage boys. About a third of the island's civilian population of roughly 300,000 died in the battle either as civilians, or as militia. As in your scenario, the invaders, the US, were not out to exterminate the Japanese and treated prisoners well.
Here's where it diverges from your scenario. The population was told the US invaders were barbarians who would torture and murder anyone they captured. While some fought out of nationalism, or to defend their homes, many fought out of fear. They did not know the US soldiers would show mercy.
Then there's the idea of the Japanese population fanatically fighting to the last. Many did, but many of the civilians were pressed into service by the military. I can think of no time when the entire population of even a major city, let alone a nation of 20 million, voluntarily fought to the death against a merciful foe.
To make your scenario work, I believe you need a population which...
- Cannot escape.
- Has to choose between fighting or being shot by their own army.
- Believes their entire civilization is in danger.
- Believes the enemy will brutalize them if they surrender.
- And cannot easily find out otherwise.
That last one is very important. If the US and Japanese could talk on the Internet, neither side would have gotten away with the depths of propaganda and dehumanization that they did. To a certain extend this happened in Germany. Once the German population had contact with the American invaders, their shared cultural heritage (there are a lot of people of German descent in the US) allowed communication and often lead to surrender rather than fanatical resistance.
In your scenario it could be...
- WWII era technology. (ie. no internet)
- Nigh insurmountable language and cultural barriers.
- Tight government control on outside communications.
Even then, I believe it implausible the entire civilian population would wipe themselves out in defense. Most would hide, surrender, or be bypassed by a merciful army intent on winning control of the island, not wiping out the population.
What could happen is their infrastructure is completely trashed. The defenders might use every building and structure as a strong point, or load them with traps. Rather than risking casualties by infantry assault, a lavishly equipped invader would rely more and more on artillery and heavy weapons to reduce every point of resistance.
Ignoring the moral implications, using all your 6 year olds as soldiers is impractical. They can barely lift a serious weapon. They won't be able to march miles and miles a day. They cannot comprehend complex orders. And I'd think fighting alongside their own children would freak out their own soldiers. If they must be put in harms way, they might be doing light labor and administrative tasks within the combat zone, or (if we've already sunk to these depths) simple suicide missions.