Railway track buckling is an important subject in railway engineering. However, research focus in open literature is mainly on static structural mechanics of tracks under thermal loads. A deeper understanding of train-track dynamics and vibration contributing to this phenomenon is vital for effective maintenance and operations of railway systems. Although computational mechanics of track structures have continued to progress in considering comprehensive train-track dynamics and vibration in three dimensions, track buckling studies using these techniques have not been published. This paper aims to address this gap by integrating a computational mechanics model of track structural buckling into a track dynamics model. The track model uses the Finite Element Method to model the rails as Euler-Bernoulli beams, while treating the other track structures as equivalent rigid bodies connected by flexible force elements with stiffness and damping components. To incorporate track structural buckling in this model, the rail stiffness is changed to include the geometrical matrix associated with the rail longitudinal force, which decreases the lateral and vertical stiffness under compression. This approach enables the investigation of the effects of dynamic longitudinal forces acting in railway track structures, along with specific influences on the vertical and lateral directions, presenting a thorough view of how these forces translate into real-world track behaviour. This paper presents a significant step in computational mechanics of railway engineering by the integration of train-track dynamics and track structural buckling using the Finite Element Method. This offers a comprehensive way to simulate arbitrarily long tracks under various conditions and contributes to a more complete understanding of the complex dynamics involved in railway track buckling.