If $V$ is a vector fielfield on $M$, its lift to $T^*M$ is ana Hamiltonian vector field with hamiltonian function $V$ (viewed as a linear function on fibresthe fibers). AndAnd if the vector field $V$ is $G$-invariant, it is also invariant as a function on $T^*M$ for the lifted action.
This has nothing to do with the fact that $V$ is a gradient.