This study presents a control strategy using a neural controller to achieve postural control in underactuated quadrupedal robots, such as balancing on two feet constrained to be fixed. Such a configuration, as in climbing animals, is the most appropriate solution for traversing uneven, slippery terrains with few safe footholds. This is one of the most challenging poses to achieve and maintain under dynamic stability in a complex, high-order, underactuated robotic structure with two fixed points. The neural network learns by mimicking an optimal controller on a variation-based linearized model of the robot. A hybrid training strategy, formulated within a Linear Matrix Inequality framework, was developed to minimize the classical accuracy index while incorporating additional constraints to ensure stability and safety based on Lyapunov theory.For the first time, a Lyapunov neural controller was successfully applied to an underactuated dynamic system to maintain critical stability conditions, extending the region of attraction for the desired equilibrium beyond that of the optimal base controller used as a teacher. The neural controller demonstrates its efficiency against disturbances and novel reference poses not encountered during training, showcasing impressive generalization capabilities. Another key advantage is the significantly increased bandwidth of the neural control loop, which is several orders of magnitude higher than that of currently used recursive optimal controllers. This strategy is validated using a realistic dynamic simulation framework.