Hinge states of second-order topological insulators as a Mach-Zehnder interferometer