Precipitation
Snow
Snow can be a problem for running trains, but it really doesn't affect the rail/ballast. Just like on highways, the snow needs to be moved away, but it doesn't have many other effects.
Trains are used to plow through small amounts (Wikipedia):

and large amounts (Wikipedia):

Ice
Ice could cause more of an issue due to adding thickness to the rails. This is mostly handled by making the trains travel slower. The weight of the wheels on the rail is enough to crush through any ice that has accumulated, i.e. trains are really heavy. As long as the train doesn't move too fast, it isn't in danger of derailing.
Track Components
Switches
Switches need to move in order to operate. Ice and snow accumulations can cause issues if they keep the components from moving. It is for this reason that most switches have switch heaters installed. These are gas powered heaters that blow hot air in the appropriate locations to melt any snow or ice.
Rail
Like mentioned above, the rails aren't really affected by ice or snow. They are just chunks of metal. The biggest issue that rails face is the cold.
Rails are restrained by rail anchors from expanding and contracting due to temperature changes. If the weather gets cold enough, the rail won't be able to contract enough and the stress will be so great that the rail will break. This isn't as much of an issue as you might think though. Many sections of railroad use the individual rails to transmit signal controls. They are set up to failsafe, so that a broken rail is the same as a broken connection. This will show a stop signal.
Ties
Ties are hunks of wood. They aren't really affected.
Ballast and subgrade
As you mentioned, freeze and thaw will cause issues due to volume changes. These effects can be foreseen and dealt with.
The ballast section should be designed to drain water. If there is no water, there is less chance of volume changes. The same can be said for the subgrade. Drainage is key.
Apart from a good design, freezing and thawing happens every year. It is very predictable. During the time periods where these effects are likely to cause issues, the track can be inspected regularly to keep it in geometric tolerance.