Climate change mitigation is a shared global challenge that involves collective action of a set of individuals with different tendencies to cooperation. However, we lack an understanding of the effect of resource inequality when diverse actors interact together towards a common goal. Here, we report the results of a collective-risk dilemma experiment in which groups of individuals were initially given either equal or unequal endowments. We found that the effort distribution was highly inequitable, with participants with fewer resources contributing significantly more to the public goods than the richer -sometimes twice as much. An unsupervised learning algorithm classified the subjects according to their individual behavior, finding the poorest participants within two "generous clusters" and the richest into a "greedy cluster". Our results suggest that policies would benefit from educating about fairness and reinforcing climate justice actions addressed to vulnerable people instead of focusing on understanding generic or global climate consequences.