The inclusive $b bar{b}$- and $c bar{c}$-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 < eta < 4.2$, and with a difference in the azimuthal angle between the two jets greater than 1.5. The integrated $b bar{b}$-dijet cross-section is measured to be $53.0 pm 9.7$ nb, and the total $c bar{c}$-dijet cross-section is measured to be $73 pm 16$ nb. The ratio between $c bar{c}$- and $b bar{b}$-dijet cross-sections is also measured and found to be $1.37 pm 0.27$. The results are in agreement with theoretical predictions at next-to-leading order.