(1) divide by mass, not weight.
(2) It's hard to answer a question like "am I on the right track?" (Pun intended?).
What part of the equations, or procedure, would you like checked? The forces, the use of Newton's laws?
I can relate a little to this as I've written code to flight simulations. There are generally two basic categories of questions one wants to answer. (1) Given the forces acting on the objects what is its trajectory? and (2) Given a trajectory what are the forces acting on the object?
There is a significant difference but both use Newton's laws. In the first case we invest a lot of effort analyzing the airfoil to get the correct lift, we model drag which can be very difficult, gravity etc. This makes sense for a missile or other object that does not have a pilot or some control mechanisms. The second case is usually appropriate for air planes with a pilot. Here you have control over the trajectory (within the laws of physics) and you are interested in what type of stress the aircraft feels under certain actions or activities. For example assuming a 2g turn what forces will the wing experience and will this cause damage. Etc.
As I read your simulation approach I wonder what your end game it. Are you trying to see under what conditions a train will derail? Or simply estimate the power consumption required to keep it at constant speed along the track.
I don't mean to be condescending with this comment/question but be sure everything is done with 3-dim vectors. I would think that there is a chance of having some vertical oscillations due to height deviations in the track/terrain. To get a realistic model of the this you would want a train model in terms of its pieces, not just a mass load, but N-cars connected by links, spring loads on each car. I have no idea if such things exist on trains (like shock absorbers). In the flight dynamics case we are sometimes interested in buffeting due to turbulence, which can be brought on by the flight itself. In this case the conditions for our aero-force model change and this can lead to instability. Are you interested in such things? Typically if you are you will need to write the code to check for such conditions and decide what action to take since your model will cease to be valid. Do you just stop and exit? Do you try to determine how the state changes and continue to propagate the state using a different set of equations and conditions? That is up to you.
So, the short answer to your question is yes, in principle you are on the right track. But there is a lot more detail to consider and it would help if you add a description of what your endgame is.
I was thinking about this more and wanted to add rotational motion. I was focusing on the translation along the track and mentioned vertical movement due to small deviations. Equally likely, small bumps and sideways deviations will cause the train cars to rotate or rock back and forth along the train axis (rolling motion). This is an important factor to consider for a realistic simulation.