When is there not a time when there could be somebody rocking up last minute to both buy their ticket and board a train?
First come, first served. It's a simple concept.
Fine at a large station with a number of clerks where you can have separate counters for tickets for immediate travel and others,
But for a small station with one clerk and a very peaky load. On occasions good customer service may sometimes dictate otherwise.
As one who occasionally buys some really time-consuming products I try to approach the ticket desk at the start of a longer rather than shorter gap between trains. Typically single-clerk stations, advanced purchase that can't be done easily on line or by phone; and I'm darned if I'm going to travel to a station with multiple open windows!