The inclusive bb¯¯bb¯- and cc¯¯cc¯-dijet production cross-sections in the forward region of pp collisions are measured using a data sample collected with the LHCb detector at a centre-of-mass energy of 13 TeV in 2016. The data sample corresponds to an integrated luminosity of 1.6 fb−1. Differential cross-sections are measured as a function of the transverse momentum and of the pseudorapidity of the leading jet, of the rapidity difference between the jets, and of the dijet invariant mass. A fiducial region for the measurement is defined by requiring that the two jets originating from the two b or c quarks are emitted with transverse momentum greater than 20 GeV/c, pseudorapidity in the range 2.2 < η < 4.2, and with a difference in the azimuthal angle between the two jets greater than 1.5. The integrated bb¯¯bb¯-dijet cross-section is measured to be 53.0 ± 9.7 nb, and the total cc¯¯cc¯-dijet cross-section is measured to be 73 ± 16 nb. The ratio between cc¯¯cc¯- and bb¯¯bb¯-dijet cross-sections is also measured and found to be 1.37 ± 0.27. The results are in agreement with theoretical predictions at next-to-leading order.