GPS stands for Global Positioning System
A handheld device which is GPS enabled uses the Global positioning satellite to accurately locate it. thus trains can use it to locate itself and thus the accurate realtime position can be known
Read the following to understand GPS better
click here