The concurrent optimization of railway alignments and station locations (RA&SL) is a complex task, especially for the main railway lines in mountainous regions. The intricate coupling constraints between RA and SL are very challenging for the conventional RA&SL search methods, which consider limited solution types to generate an optimized RA&SL solution. To solve this problem, an event tree-based distance transform (ET-DT) algorithm is proposed. The study area is first divided into grid cells, followed by a preprocessing step to identify infeasible areas for station locations. Next, an event tree (ET) is constructed to represent all the possible solution types during the RA&SL design process. Afterward, in the ET-DT method, a total of eight types of RA&SL search operators are integrated to generate diverse RA&SL alternatives. Ultimately, the proposed method is applied to a realistic case with significantly-undulating terrain. Results show that ET-DT generates 2.8 times more solutions than a contemporary DT-based method (PreDT) and further improves solution quality through an 8.7% reduction in construction cost compared to the best manually-designed alignment, while PreDT only achieves a 5.7% reduction.