Is each unit's mpg fairly constant? I assume so so that you can tell when they need refuelling.
As I put upthread, but I'll expand –
During construction/commissioning of a type, fuel consumption is looked at across a range of duty cycles. From that a safe fuel range is devised - that range won't drain the tank, but it'll use the vast majority of the fuel (maybe 80-95%). Consumption rate does vary depending on how the train is driven, but the fuel range should account for that. Very occasionally when a type migrates to another area the fuel range will change as the duty cycle is radically different. At GWR for example our 165/166s currently run to 1200mi, however with the migration west that's now thought to be a lot closer to the limit than it is in Thames Valley. Investigations are going on to see whether it is prudent to revise that range down to 1000mi.
Control staff and depots will work to that mileage, and we should
never take a unit over the mileage. In reality, mistakes happen - a unit is thought to be fully fuelled but hasn't, or the work todo isn't looked at closely enough and a set goes over miles.
That is when sight glasses or TMS readouts come into play, and we have tables that give an indication of how far we can get on 1/xth of a tank.