The versions of this song in which John Henry dies are management's view. Labor's view is that he won the contest easily but was replaced by the steam drill anyway.
It's highly unlikely that a man who hammered a steel rod all day long for a living would die of exhaustion or heart failure during a hammering contest which he won 16 to 9.
The danger in steel-driving is to the shaker, who holds the steel rod in position, shaking it as needed to get it into the exact right spot so the hammer lands on it rather than on himself. He's the one who said that he'd be willing to die, with a steel rod in his hand, rather than let any steam drill beat him down.