This letter presents a combined measurement of the energy spectra of atmospheric $ u_e$ and $ u_mu$ in the energy range between $sim$100 GeV and $sim$50 TeV with the ANTARES neutrino telescope. The analysis uses 3012 days of detector livetime in the period 2007--2017, and selects 1016 neutrinos interacting in (or close to) the instrumented volume of the detector, yielding shower-like events (mainly from $ u_e+overline u_e$ charged current plus all neutrino neutral current interactions) and starting track events (mainly from $ u_mu + overline u_mu$ charged current interactions). The contamination by atmospheric muons in the final sample is suppressed at the level of a few per mill by different steps in the selection analysis, including a Boosted Decision Tree classifier. The distribution of reconstructed events is unfolded in terms of electron and muon neutrino fluxes. The derived energy spectra are compared with previous measurements that, above 100 GeV, are limited to experiments in polar ice and, for $ u_mu$, to Super-Kamiokande.