A search for heavy Majorana neutrinos in scattering of same-sign W boson pairs in proton–proton collisions at s=13 TeV at the LHC is reported. The dataset used corresponds to an integrated luminosity of 140 fb−1, collected with the ATLAS detector during 2015–2018. The search is performed in final states including a same-sign ee or eμ pair and at least two jets with large invariant mass and a large rapidity difference. No significant excess of events with respect to the Standard Model background predictions is observed. The results are interpreted in a benchmark scenario of the Phenomenological Type-I Seesaw model. New constraints are set on the values of the |VeN|2 and |VeNVμN⁎| parameters for heavy Majorana neutrino masses between 50 GeV and 20 TeV, where VℓN is the matrix element describing the mixing of the heavy Majorana neutrino mass eigenstate with the Standard Model neutrino of flavour ℓ=e,μ. The sensitivity to the Weinberg operator is investigated and constraints on the effective ee and eμ Majorana neutrino masses are reported. The statistical combination of the ee and eμ channels with the previously published μμ channel is performed.