Sliding is prevented by friction and the friction force is equal to the product of the weight - the perpendicular force - and the dimensionless coefficient of static friction.
The coefficient of static friction between steel and steel can be as high as 0.78 so the angle would have to be hugely non-horizontal for the train to slide. And a lot of acceleration may be added, too.
The lowest coefficient of static friction in wet and greasy conditions may be 0.05 which is approximately the angle in radians where one could start to get worried. It is just 3 degrees and if there's lot of oil everywhere on the tracks, the train may get unsafe already for these small angles. However, in reality, the coefficient never drops this low and 15 degrees is usually a safe angle.
See also:
http://en.wikipedia.org/wiki/Rail_adhesion
Note that the coefficient of static friction is higher than the coefficient of kinetic friction so the hardest thing is to start the sliding. Once the train starts to slide, it is more likely that it will continue to do so.
All the text above was about the sliding - the stability in the front-rear direction. The stability in the left-right direction is guaranteed by the shape of the wheels:
You are right; the magnitudes of the translational and rotational kinetic energies are the same.
In general, the kinetic energy of a mass distribution can be written
$$K = K_{cm} + K_{rel}$$
$K$ is the total kinetic energy. $K_{cm}$ is the kinetic energy of a point particle whose mass is equal to the total mass of the distribution, if the point particle is moving along with the center of mass of the distribution. $K_{rel}$ is the kinetic energy of the mass distribution as viewed in the center-of-mass reference frame. This is a basic theorem you can prove by writing down the integral of $\rho v^2$ over all space ($\rho$ being the mass density).
Intuitively, here is a way to see what this says. Suppose you are pushing a car, and your goal is to get the car up to $2 \mathrm{m/s}\,$ when you push it over a flat stretch of parking lot, so there is a certain amount of work you are trying to do on the car.
Now imagine the car has a flywheel inside. This is a heavy disk that may or may not be rotating at high speed, storing a great deal of kinetic energy. The theorem says that whether or not the flywheel is going does not matter to you. The work you do on the car is the same regardless of the state of the flywheel as long as the flywheel does not change its rotational speed while you're pushing the car. Only the total mass of the flywheel matters, and then only because it is being accelerated along with the rest of the car. The exact shape, orientation, etc of the flywheel don't affect the amount of work you need to do.
The same is not true for the wheels. The rotation state of the wheel changes as you accelerate the car, so the moment of inertia of the wheels is relevant, in addition to their mass.
For the case of the hoop, the kinetic energy is
$$K = \frac{1}{2}mv_{cm}^2 + \frac{1}{2}I\omega^2$$
where $I$ is the moment of inertia for rotations about the center of the hoop and $\omega$ is the angular velocity.
If the mass is all located at the rim of the hoop, then $I = mR^2$, and because $v_{cm} = \omega R$ you can write
$$K = \frac{1}{2}mv_{cm}^2 + \frac{1}{2}(mR^2)\left(\frac{v_{cm}}{R}\right)^2$$
Canceling the $R^2$ in the numerator and denominator of the second term, we see that the translation and rotational kinetic energies are the same in this case. The total kinetic energy is $mv_{cm}^2$
You can find the final speed of the hoop after it rolls down a hill by conservation of energy using this formula for the kinetic energy.
If you have a mass in the center of the hoop, you can adjust the moment of inertia depending on the relative masses of the hoop and the thing at the center and continue to use the general equation for the kinetic energy of a mass distribution. You will find that the kinetic energy is still proportional to $mv^2$, but the constant of proportionality is less than one. Otherwise you may account for the mass at the center of the hoop separately in the expression for the energy.
Best Answer
Shift the upper configuration to the left a short distance at equilibrium. Result: the left wheel goes a little up, the right goes a little down, the train tilts clockwise, the center of mass is to the right of the centerline between the wheels, and therefore the center of mass provides a restorative force to push the train back to the right.
Shift the lower configuration to the left a short distance at equilibrium. The argument proceeds in reverse and the center of mass provides an anti-restorative force, pushing the train further to the left. Pain ensues.
You're trading $m \ddot x = - k x$ (harmonic oscillator) for $m \ddot x = k x$ (exponential diverger) and praying that the implicit drag forces keep the thing diverged only a small amount. That's a risky game, no doubt.