Sonar is the solution; passive sonar using numerous hydrophones to chart the bearing of the whale. How that bearing changes over time allows you to deduce if you're on a collision course. This is tech developed by the military.