The ability to accurately predict vehicle trajectories is essential in infrastructure-based safety systems which aim to identify critical events such as near-crash situations and traffic violations. In a connected environment, important information about these critical events can be communicated to road users or the infrastructure to avoid or mitigate potential crashes. Intersections require special attention in this context because they are hotspots for crashes and involve numerous and complex interactions between road users. In this project we developed an advanced machine learning method for trajectory prediction using B-spline curve representations of vehicle trajectories and Inverse Reinforcement Learning (IRL). B- Spline curves were used to represent vehicle trajectories, and a neural network model was trained to predict the coefficients of these curves. A conditional variational autoencoder (CVAE) model was used to create candidate trajectories. These candidate trajectories were then ranked according to a reward function that was obtained by training an IRL model on the (spline smoothed) vehicle trajectories and the surroundings of the vehicles. In our experiments we found that the neural network model outperforms a Kalman Filter baseline and the addition of the IRL ranking module further improves the performance of the overall model.