This was quite an interesting event that happened recently in Scotland:
https://assets.publishing.service.gov.uk/government/uploads/...
Basically the train lost the ability to brake and effectively rolled backwards and forwards over a 4.7 mile section of track, with gradients on either end, until it came to a stop in the lowest section of the line see page 11).
https://www.gov.uk/government/organisations/rail-accident-in...