Initially, inhomogeneous plasma jets, ejected by active galactic nuclei and associated with gamma-ray bursts, are thermalized by the formation of internal shocks. Jet subpopulations can hereby collide at Lorentz factors of a few. As the resulting relativistic shock expands into the upstream plasma, a significant fraction of the upstream ions is reflected. These ions, together with downstream ions that leak through the shock, form relativistic beams of ions that outrun the shock. The thermalization of these beams via the two-stream instability is thought to contribute significantly to plasma heating and particle acceleration by the shock. Here, the capability of a two-stream instability to generate relativistic field-aligned and cross-field electron flow, is examined for a magnetized plasma by means of a particle-in-cell (PIC) simulation. The electrons interact with the developing quasi-electrostatic waves and oblique magnetic fields. The simulation results bring forward evidence that such waves, by their non-linear interactions with the plasma, produce a highly relativistic field-aligned electron flow and electron energies, which could contribute to the radio synchrotron emissions from astrophysical jets, to ultrarelativistic leptonic subpopulations propagating with the jet and to the halo particles surrounding the accretion disc of the black hole