When two ways (two railways, or two parts of a motorroad) are close together they start overlapping at some point when going to smaller scale, like railway in this picture:

Cartographic fix for this is to make one way instead of two (or more). One of the simplest ways to do that is to create a buffer and then calculate medial axis (standard functionality of PostGIS):
(here blue lines - initial ways, black one - generalised)
This way the map is more legible, and for vector tiles - it is smaller - therefore faster to download and gives less load on cpu on client side:
Check the change live in the topographic map 13+ - non generalised ways, 12.99- - generalised ways.
NOTE: The same generalisation operation has to be done with roads.
Discussion