Symmetries in the Lagrangian and Hamiltonian Formalism: The Equivariant Inverse Problem