Astrophysical shocks at all scales, from those in the heliosphere up to cosmological shock waves, are typically ‘collisionless’, because the thickness of their jump region is much shorter than the collisional mean free path. Across these jumps, electrons, protons and ions are expected to be heated at different temperatures. Supernova remnants (SNRs) are ideal targets to study collisionless processes because of their bright post-shock emission and fast shocks, but the actual dependence of the post-shock temperature on the particle mass is still widely debated1. We tackle this longstanding issue through the analysis of deep multi-epoch and high-resolution observations, made with the Chandra X-ray telescope, of the youngest nearby supernova remnant, SN 1987A. We introduce a data analysis method by studying the observed spectra in close comparison with a dedicated full three-dimensional hydrodynamic simulation that self-consistently reproduces the broadening of the spectral lines of many ions together. We measure the post-shock temperature of protons and ions through comparison of the model with observations. Our results show that the ratio of ion temperature to proton temperature is always significantly higher than one and increases linearly with the ion mass for a wide range of masses and shock parameters.