Here "hearts" refers to their courage. They were so afraid that it was as if their courage melted away like wax in a fire. Alternate translation: "they lost all their courage" (See: [[rc://en/ta/man/translate/figs-metonymy]] and [[rc://en/ta/man/translate/figs-metaphor]])
Here "spirit" refers to their will to fight. Alternate translation: "they no longer had any will to fight" (See: [[rc://en/ta/man/translate/figs-metonymy]])