Inelastic energy losses in small-angle scattering of energetic particles