The wheel–rail contact plays a vital role in railway transportation, hence an accurate wheel–rail contact model is the key to the simulation of railway vehicle dynamics. Though Kalker's variational theory is the canon, fewer works try to embed it into railway vehicle dynamics, mainly due to the computational efficiency problem and the complex wheel–rail geometry processing. This paper proposes a wheel–rail geometry processing method to embed KVT into railway vehicle multi-body dynamics based on the trajectory coordinate formulation, which conveniently introduces the wheel–rail contact surface pair for tracking the potential contact areas. After this prior detection, coarse detection is performed to narrow the range of penetrated elements. Multiple contact patches can also be identified based on the connection topology of discrete elements of wheel–rail surfaces. Thus, Kalker's variational theory can be used on each separate patch for local contact evaluation. An initial prediction method for the contact status is embedded in the multi-body dynamics simulation to accelerate the solution of Kalker's variational problem, in which the tractions with contact divisions obtained from the neighbouring system states are selected as the iterative initial value. The importance of predicting the contact tractions and demarcation for the convergence of the iteration is revealed. The proposed method is fully demonstrated by the Manchester contact benchmark and simulations of a railway vehicle passing through a curved track. As an advantage of embedding Kalker's variational theory, the precise traction pattern is obtained simultaneously along with the vehicle dynamics simulation, and the influencing mechanism of the track geometry on the vehicle system is analysed. The improvement of solution efficiency is also verified in simulations.