Grant to stop trespassing on railways