Hypersonic air-breathing vehicles, utilizing ramjet and scramjet propulsion systems, are emerging as a promising option for future hypersonic transportation due to high specific impulse. The performance of hypersonic aircraft is significantly influenced by their flight trajectory, as combustion efficiency and aerodynamic forces vary markedly with altitude. Although numerous studies have focused on optimizing these trajectories, they have not adequately considered the potential for operational failures in the propulsion system, such as unstart and blowout. This study introduces a trajectory optimization approach for hypersonic aircraft that proactively addresses and mitigates these operational failures. This is achieved by establishing an operational classification process for a dual-mode scramjet engine and proposing a failure mode avoidance strategy using a Gaussian process classifier. Optimized ascent trajectories are achieved through the development of a two-stage robust sequential convex programming approach. The results of trajectory optimization indicate that the failure mode avoidance strategy proposed is crucial in obtaining minimal time trajectories, and that the optimal trajectories include drop motion in the initial stage flight in order to increase combustion efficiency.