Most train control software uses information about a loco's speed as well as triggered feedbacks to determine a train's position. That's why it may be necessary to calibrate a loco and give the software information about how fast a loco goes at which speed steps, as well as how long your blocks are and where the feedbacks are located. There are ways to automate the locoIt is possible that some computer control systems use 'dead reckoning' for basic train location information. Once the software knows how far the speed steps sent to a loco will send it, they can start from a known position and keep track by knowing the route it took.
calibration process, which should be a once-off but can take a while (iTrain certainly does).
JMRI appears to have support for some RFID readers, but it is classed as 'evolving'. RocRail has support for RFID as well, including the MERG system, but it again comes with a number of caveats. iTrain does not support RFID recognition at this time.