In TOF Mass Spectrometry how does the detector 'know' the difference between ions of different elements? After the positive ions have been accelerated, I know that they travel through the drift zone at different speeds due to their masses. 

But surely, a heavier ion/element that enters the drift zone first may still reach the detector before a lighter ion if that lighter ion is one of the last ions to enter the drift zone. If so, when these ions reach the detector, how does it know that the heavier ion IS heavier than the lighter ion that does not reach the detector until afterwards.

*I'm aware my question is a tad confusing, let me know if I should try and reword it!
I suppose that you are referring to a Wiley–McLaren time‐of‐flight mass spectrometer [Rev. Sci. Instr. 65, 3344 (1994)] which is basically a tube containing an electrode stack for accelerating the ions toward a detector. As mentioned in the comments, one can discriminate different masses if one uses a pulsed experiment, for instance using pulsed lasers or pulsed electric fields to extract the ions. 

Another option is to add a magnetic field to the setup in order to bend the trajectory of the ions. The radius of the trajectory depends on the mass-to-charge ratio of the ion and one can record spectra as a functoin of the magnetic field to get a certain mass selected or use a position-sensitive detector to measure several masses simultaneously.    

Yet another solution is to use quadrupole–time-of-flight mass
spectrometry, where radio frequencies are applied to four electrode rods placed on the circumference of a circle. Depending on the frequency that is applied to the rods, only ions of a certain mass-to-charge ratio make it out of the quadrupole and the qaudrupole thus serves as a mass filter. 

Note that all these techniques are sensitive to the mass-to-charge ratio only and one cannot distinguish between, e.g., O$^+$ and S$^{2+}$.