This study incorporates fairness preference theory into the principal-agent model to address the challenges arising from information asymmetry between the government and railway infrastructure operation and maintenance (O&M) companies. It develops an incentive and supervision model for the management of mega railway infrastructure operations and maintenance, considering two perspectives: full rationality and fairness preference. The models are compared and analyzed, exploring the costs of government supervision and the changes in expected benefits when equity preference is taken into account. The conclusions are supported by numerical examples and visual analysis, illustrating the impact of different variable parameters on the behavioral strategies of the government and O&M companies. The findings demonstrate that a well-designed incentive and supervision mechanism can effectively regulate the behavior of railway infrastructure O&M companies. The effort level of O&M companies is positively correlated with the intensity of government incentives and supervision. Moreover, from the perspective of fairness preference, transferring some financial benefits from the government to O&M companies not only increases their extra effort but also reduces government’s supervision costs, while the government’s expected utility gain depends on the strength of “reciprocity” exhibited by O&M companies.