The Standard Model of particle physics encapsulates our current best understanding of physics at the smallest scales. A fundamental axiom of this theory is the universality of the couplings of the different generations of leptons to the electroweak gauge bosons. The measurement of the ratio of the rate of decay of W bosons to τ-leptons and muons, R(τ/μ) = B(W → τντ)/B(W → μνμ), constitutes an important test of this axiom. A measurement of this quantity with a novel technique using di-leptonic tt̄ events is presented based on 139 fb-1 of data recorded with the ATLAS detector in proton--proton collisions at √s = 13 TeV. Muons originating from W bosons and those originating from an intermediate τ-lepton are distinguished using the lifetime of the τ-lepton, through the muon transverse impact parameter, and differences in the muon transverse momentum spectra. The value of R(τ/μ) is found to be 0.992 ± 0.013 [± 0.007 (stat) ± 0.011 (syst)] and is in agreement with the hypothesis of universal lepton couplings as postulated in the Standard Model. This is the most precise measurement of this ratio, and the only such measurement from the Large Hadron Collider, to date.