My impression is that "derail" alludes to something which moves along a rail, or rails. It's going somewhere. It's on a path to somewhere/something. (Eg, a railroad train)
We speak of derailing our plans, our future, the future of our relationship. To derail something is to knock it off it's rails, so it can not complete its journey.