Surges are ubiquitous cool ejections in the solar atmosphere that often appear associated with transient phenomena like UV bursts or coronal jets. Recent observations from the Interface Region Imaging Spectrograph (IRIS) show that surges, although traditionally related to chromospheric lines, can exhibit enhanced emission in Si IV with brighter spectral profiles than for the average transition region (TR). In this paper, we explain why surges are natural sites to show enhanced emissivity in TR lines. We performed 2.5D radiative-MHD numerical experiments using the Bifrost code including the nonequilibrium ionization of silicon and oxygen. A surge is obtained as a by-product of magnetic flux emergence; the TR enveloping the emerged domain is strongly affected by nonequilibrium effects: assuming statistical equilibrium would produce an absence of Si IV and O IV ions in most of the region. Studying the properties of the surge plasma emitting in the Si IV 1402.77Å and O IV 1401.16Å lines, we find that a) the timescales for the optically-thin losses and heat conduction are very short, leading to departures from statistical equilibrium, and b) the surge emits in Si IV more and has an emissivity ratio of Si IV to O IV larger than a standard TR. Using synthetic spectra, we conclude the importance of line-of-sight effects: given the involved geometry of the surge, the line-of-sight can cut the emitting layer at small angles and/or cross it multiple times, causing prominent, spatially intermittent brightenings both in Si IV and O IV.