Maybe in addition to the ticket machine system some sort of app system could be used. Maybe you have to scan an NFC beacon or barcode on the platform through an app which serves as a P2P. I can't see a way to do it with GPS as you could do it as soon as you see the conductor. Again wouldn't be able to replace the ticket machine for people without/don't want to use a smartphone, but could cut help to keep queues down if this proves problematic and could be quicker then going through all the buttons on the ticket machine and less prone to abuse.
Edit: Suppose though this would be open to abuse if someone just took photos/nfc duplicates of all the stations on their train. And simply scanned the last one only when they saw the conductor come through.
Edit: Suppose though this would be open to abuse if someone just took photos/nfc duplicates of all the stations on their train. And simply scanned the last one only when they saw the conductor come through.