A numerical simulation of decelerating, scattering, and trapping fast electrons by plasma in a magnetic trap is reported. Fast non-thermal electrons are generated via the interaction of the relativistic electron beam with the plasma. Their energy significantly exceeds the thermal energy of plasma particles. For real experimental conditions where the mean free path of electrons is larger than the length of a local magnetic pit, the kinetic equation for distribution function of electrons is numerically solved. The effect of electron scattering and trapping into the pit is calculated.