The recent trend towards the smart transportation system has spurred the development of the smart railway. However, enabling trains with seamless wireless connectivity using the roadside units (RSUs) is extremely challenging, mostly due to the lack of line of sight link. To address this issue, we propose a novel framework that uses intelligent reflecting surfaces (IRS)-enabled unmanned aerial vehicle (UAV) to provide line of sight communication to the smart railway system. First, we formulate the optimization problem where the objective is to maximize the minimum achievable rate of trains by jointly optimizing the trajectory of UAV and the phase-shift of IRS. Due to the non-convex nature of the formulated problem, it is decomposed into two subproblems: IRS phase-shift problem and UAV trajectory optimization problem. Next, a Binary Integer Linear Programming (BILP) and a Soft Actor-Critic (SAC) are constructed in order to solve our decomposed problems. Finally, comprehensive numerical results are provided in order to show the effectiveness of our proposed framework.