Train/Tram Bogie Rigging for Animation

I am a beginner to Blender and have been searching unsuccessfully on Youtube for a tutorial on how to attach wheel assemblies (bogies/trucks/trolleys) to the body of a train or tram so that the bogies pivot on their vertical axes when following a curved path. I can’t imagine for a skilled modeller this would present much of a difficulty to achieve, but I just can’t figure it out.

I have created a simple model out of three cubes that vaguely look like a tram, see below image, and can get them to follow the path, but as can be seen by the image, things don’t line up when going around a corner.

Screen Shot 2021-04-26 at 12.00.47 pm|690x471