We present observations of electron energization in magnetic reconnection outflows during the pre-impulsive phase of solar flare SOL2012-07-19T05:58. During a time-interval of about 20 minutes, starting 40 minutes before the onset of the impulsive phase, two X-ray sources were observed in the corona, one above the presumed reconnection region and one below. For both of these sources, the mean electron distribution function as a function of time is determined over an energy range from 0.1~keV up to several tens of keV, for the first time. This is done by simultaneous forward fitting of X-ray and EUV data. Imaging spectroscopy with RHESSI provides information on the high-energy tail of the electron distribution in these sources while EUV images from SDO/AIA are used to constrain the low specific electron energies. The measured electron distribution spectrum in the magnetic reconnection outflows is consistent with a time-evolving kappa-distribution with $kappa =3.5-5.5$. The spectral evolution suggests that electrons are accelerated to progressively higher energies in the source above the reconnection region, while in the source below, the spectral shape does not change but an overall increase of the emission measure is observed, suggesting density increase due to evaporation. The main mechanisms by which energy is transported away from the source regions are conduction and free-streaming electrons. The latter dominates by more than one order of magnitude and is comparable to typical non-thermal energies during the hard X-ray peak of solar flares, suggesting efficient acceleration even during this early phase of the event.