To limit the probability that static electric charges will build up, which could lead to the ignition of nearby vapour, which could lead to harm to persons.
To limit the probability that a distant lighting strike will travel through the rails, which could lead to the creation of a source of ignition, which could lead to the ignition of nearby vapour, which could lead to harm to persons.