We investigate the dust energy balance for the edge-on galaxy IC 2531, one of the seven galaxies in the HEROES sample. We perform a state-of-the-art radiative transfer modelling based, for the first time, on a set of optical and near-infrared galaxy images. We show that by taking into account near-infrared imaging in the modelling significantly improves the constraints on the retrieved parameters of the dust content. We confirm the result from previous studies that including a young stellar population in the modelling is important to explain the observed stellar energy distribution. However, the discrepancy between the observed and modelled thermal emission at far-infrared wavelengths, the so-called dust energy balance problem, is still present: the model underestimates the observed fluxes by a factor of about two. We compare two different dust models, and find that dust parameters, and thus the spectral energy distribution in the infrared domain, are sensitive to the adopted dust model. In general, the THEMIS model reproduces the observed emission in the infrared wavelength domain better than the popular BARE-GR-S model. Our study of IC 2531 is a pilot case for detailed and uniform radiative transfer modelling of the entire HEROES sample, which will shed more light on the strength and origins of the dust energy balance problem.