Why doesn't Ukraine just surrender and live?
Because it's better to die fighting for what you believe in, with honour and courage, than surrendering and dying in some Russian holocaust style gas/torture chamber hell.
If they surrender they are dead men/woman/children walking anyway, the logical option is to fight.