Loop-tree duality for integrals on the moduli space of graphs