(I'm talking about the classical mechanics.)
Many texts say that Lagrange equations are difficult to treat numerically because they are second-order ODEs, ${f_i(\boldsymbol{q, \dot{q}, \ddot{q}}}) = 0$, and Hamilton equations are (at least computationally) great because they are first-order, or their forms are essentially ${\dot{p_i}=g_i(\boldsymbol{p, q})}$ and $\dot{q_i}=h_i(\boldsymbol{p, q})$.
I wonder if this statement is really valid? We can easily convert the Lagrange equations to first-order by, as a common technique, defining the new independent variables $v_i:=\dot{q_i}$.
Right, then we have to first solve the Lagrange equations for $\ddot{q_i}$ algebraically so that the equation can become $\dot{q_i}=v_i$ and $\dot{v_i}=(solved\ as\ \ddot{q_i})$. People say this is difficult and thus Hamilton's formalism is awesome.
However, in the process of Legendre transformation from Lagrangian $L$ to Hamiltonian $H$, we have to determine $\dot{q}$ as $\dot{q}(\boldsymbol{p, q})$ by algebraically solving the definitions $$ p_i=\frac{\partial L}{\partial \dot{q_i}} $$ which is a system of equations.
So, in the both cases, we have to solve a set of algebraic equations anyway.
Is the latter solving process actually easier than the former in general? If there is, please give me an example where we can't use the former (Lagrange) but can use the latter (Hamilton) to make it first-order.