Morse Index Theorem of Lagrangian Systems and Stability of Brake Orbit