Geometric Hamiltonian formalism for reparameterization-invariant theories with higher derivatives