Facing a global challenge such as climate change brings out consequences on wealth inequalities due to diverse propensities or capacities for cooperation. Here, we focus on the effect of resource inequality on climate change mitigation, and how individuals with different resources act when cooperating in this crucial endeavour. We addressed these questions by performing a lab-in-the-field experiment with 320 participants, and based it on the collective-risk dilemma setup by Milinski et al. Our results show that participants with fewer resources contributed significantly more to the public goods than those who are wealthier. The set of decisions taken by each participant were classified using an unsupervised learning algorithm. The analysis assigns wealthy participants to the greedy cluster, whereas not-wealthy participants mostly belong to most generous clusters. Our results suggest that policies would benefit from educating about fairness and reinforcing climate justice actions addressed to vulnerable people.