Many phenomena in solid-state physics can be understood in terms of their topological properties. Recently, controlled protocols of quantum walks are proving to be effective simulators of such phenomena. Here we report the realization of a photonic quantum walk showing both the trivial and the non-trivial topologies associated with chiral symmetry in one-dimensional periodic systems, as in the Su-Schrieffer-Heeger model of polyacetylene. We find that the probability distribution moments of the walker position after many steps behave differently in the two topological phases and can be used as direct indicators of the quantum transition: while varying a control parameter, these moments exhibit a slope discontinuity at the transition point, and remain constant in the non-trivial phase. Extending this approach to higher dimensions, different topological classes, and other typologies of quantum phases may offer new general instruments for investigating quantum transitions in such complex systems.