New York City subway trash bins are typically encased in an immovable metal casing to prevent accidents like this one, but attentive MTA employees, or the train's conductor also could have helped.
The explosion was likely a combination of the collision, pressure, and a bit of third-rail electricity. A tad frightening and completely preventable.