Stochastic heating of small grains is often mentioned as a primary cause of large infrared (IR) fluxes from star-forming galaxies, e.g. at 24mu 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 infrared dark cloud core. We show that stochastic heating, induced by the standard interstellar radiation field, cannot explain high mid-IR emission toward the centre of the core. In order to reproduce the observed emission from the core projected centre, in particular, at 24mu 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, that is not observed. We discuss possible implications of this finding and also discuss a role of other non-radiative dust heating processes.