The growing complexity of railway infrastructure projects has created greater demand for knowledge-driven and collaborative design approaches. However, existing digital design approaches mainly focus on data exchange and model representation, while challenges remain, including semantic inconsistencies in multidisciplinary information, insufficient formalization of engineering knowledge, and limited reuse of parametric components. To address these issues, this study proposes an ontology-based, knowledge-driven framework for railway infrastructure design by integrating semantic modeling, rule-based reasoning, and IFC-based parametric component generation. First, a modular Railway Survey and Design Ontology (RSDO) is developed to provide a unified semantic representation of multidisciplinary engineering entities, spatial relationships, components, attributes, and measurement units. Existing ontologies, including BOT, BPO, and QUDT, are reused and extended to improve semantic interoperability across the railway survey and design stages. Second, a rule-transformation approach is proposed to convert engineering standards and expert knowledge into executable SWRL reasoning rules and SPARQL queries, thereby enabling rule-based design decision support and semantic retrieval of engineering knowledge. Third, a strategy for constructing an IFC-based parametric component library is established, incorporating knowledge-driven parametric generation to support reusable and software-independent component modeling. A tunnel portal design case study is conducted to demonstrate and validate the proposed framework. The results demonstrate that the framework can integrate heterogeneous survey and design information, infer design-related knowledge through semantic reasoning, and generate IFC-based parametric components containing both geometric and semantic information. The proposed framework provides a knowledge-driven approach to automated design decision-making and knowledge reuse in railway infrastructure design.