After his return to the state railway he began with the planning of the railway line to the south, from Mürzzuschlag to Graz and Trieste. The crossing of the Semmering was not believed possible, but as early as 1844 he submitted a plan for the crossing of the Semmering, with locomotives without an extra rail for gear wheels. Before the building was fully decided, he began to enforce the construction of locomotives which could overcome such upward gradients. Construction of the Semmeringbahn was begun in 1848 and completed in 1854. In 1856, the Borovnica viaduct, one of the most imposing railroad bridges of the era, was built upon the plans by von Ghega as part of the Austrian Southern Railway from Vienna to Trieste.