Well i believe the solution of this problem is to have Elevated Railway Track. You can refer to Kenya railway for that. In order to protect wild life in one of the biggest National Park they built the elevated rail line ( Mombasa to Nairobi) in the national Park section. One can google for the same. It will not be 100 % effective at least it will reduce the causalities drastically.