Stabilization of underactuated mechanical systems is one of the fundamental benchmark problem in the field of control theory. In this article, a hierarchical sliding mode control based on state-dependent switching gain is proposed for stabilization of underactuated mechanical systems. This controller is based on the so called first-level and second-level sliding surfaces. The asymptotic stability of these surfaces is proved by the Lyapunov stability theory. The proposed control technique is applied to two nonlinear underactuated mechanical systems and its feasibility is verified by numerical simulation. The proposed controller efficiently tackles the bounded external disturbance and shows robust performance. The convergence rate of the proposed controller is much faster as compared with the conventional decoupled sliding mode control and the integral sliding mode control.