Riemannian Isometries Preserve Lengths of Piecewise Smooth Curves