How can a railcar withstand high pressure but fail under a vacuum?
A pressure vessel consists mainly of a thin metal plate. If you experiment with a thin sheet of material (for example a piece of paper) you will find that it is very easy to bend it, but much harder to stretch it.
If there is internal pressure in a spherical or cylindrical vessel, the only way the pressure can do mechanical work (i.e. force $\times$ distance) is to increase the internal volume of the vessel, and the only way to do that is to stretch the material, which is difficult.
However, external pressure can do work by reducing the internal volume, and that is easy to do without stretching the vessel wall, by breaking the original cylindrical or spherical symmetry of the vessel and "crumpling" the wall. Since the structure will never be a perfectly uniform shape, there will always be a "weak point" somewhere from which the crumpling can start. This page http://publish.ucc.ie/boolean/2010/00/dePaor/11/en has some nice pictures showing what happens.
The basic principle works exactly the same way with simpler geometry, for example Euler buckling of a column. If you apply a tension load to a column, the only possibility is to stretch the material and make the column longer. But if you apply a compressive load, you can make the column shorter without changing the length of the material, when it buckles into a curved shape.
Expanding pressures have a very different effect than crushing pressures. Expanding pressure tends to be stable. If there is a defect in the shape of the railcar, the pressures tend to push it outward into the proper shape. However crushing pressures are unstable. If there is a defect in the rail car in your vacuum example, it tends to pull the defect further away from the correct shape. This makes the defect worse, and starts causing a runaway effect.
We can see this effect on a human scale with a 2 liter bottle of soda. It can obviously withstand a great deal of pressure from the inside as the soda is under pressure when delieverd. If you empty the bottle and try to blow it up with your own breath, you'll quickly find that the bottle is way stronger than you are in this direction. However, if you evacuate the bottle by sucking air out of it, it takes almost no effort at all.
The sealing of a port in a pressure vessel might use the pressure in the vessel to compress a seal (push an O-ring firmly against a door); such a seal will not be properly compressed if the vessel is under vacuum.
Many pressure vessels, with thin walls, use pressure-induced tension to hold the shape (like a balloon); under negative pressure, like a balloon, that kind of vessel will collapse.