There is a device known as a derailer which is used to intentionally derail trains that enter into unauthorized areas.