Stochastic heating of small grains is often mentioned as a primary cause of large infrared (IR) fluxes from star-forming galaxies, for example, at 24 m. If the mechanism does work at a galaxy-wide scale, it should show up at smaller scales as well. We calculate temperature probability density distributions within a model protostellar core for four dust components: large silicate and graphite grains, small graphite grains, and polycyclic aromatic hydrocarbon particles. The corresponding spectral energy distributions are calculated and compared with observations of a representative IR dark cloud core. We show that stochastic heating, induced by the standard interstellar radiation field, cannot explain high mid-IR emission towards the centre of the core. In order to reproduce the observed emission from the core projected centre, in particular, at 24 m, we need to increase the ambient radiation field by a factor of about 70. However, the model with enhanced radiation field predicts even higher intensities at the core periphery, giving it a ring-like appearance, which is not observed. We discuss possible implications of this finding and also discuss the role of other non-radiative dust heating processes.