Why would an unpatriotic conscripted army with a much lower number of loyal soldiers compared to random people continue to fight a losing battle against a superior rebel force, which stood to have a good chance of capturing the kingdom?

The soldiers are obviously losing, unenthusiastic, and will probably not face recriminations for deserting and going home (the king has other problems, for example, the huge rebel army on his doorstep).  

What reason could the troops have to continue fighting?

**EDIT:** The king has limited resources (he's fighting a war!) so no enormous number of hostages. He also is unable to punish all the deserters (or even many of them) effectively, so that's not a huge worry either. Also, these conscripts are going to die or be captured if they keep fighting forever.  

They do break eventually, but around 1/4 of them die first. But there is no way they are winning this battle. They know this from 5 minutes in.  

**EDIT:** Forget the 1/4 half to die part. They actually need to kill some key rebel commanders (who are OP warriors) by somehow reaching them so I can write an awesome death scene for them.  

**EDIT:** The soldiers in the King's army are mostly from urban areas.