Humans are no different. Given a clear life or death choice, they almost always choose life. However, give them a choice that affects the chance of death, and it is not so clear. There is a long list of things that people do where they are willing to accept an increase in their risk of death in exchange for some sort of a payoff. I'm not up on the evolutionary arguements for this behavior, but I suspect they go something like this.
Organisms are in competition with eachother.
The objective of this competition is to maximize the number of offspring with reproductive ability in the next generation that carry ones genes. Taking a risk, like the rat going for the bucket with a larger treat, will have a positive fitness payoff in the event that the bad outcome does not occur. If, on average, the fitness gain of taking the risk exceeds the fitness cost when the bad outcome occurs, the risk taking behavior will dominate. For the case of a certain bad outcome, the average effect is negative. Thus, don't stand in front of traffic.