I think we need some definitions here. Based on the OP's initial post it seems they're thinking of:
- locomotives
- hauling passenger services
- on main lines
Which eliminates branch lines and narrow gauge.
Based on that here's everything (I think) has been mentioned in this thread so far that meets those criteria:
Class | Route | Years in service | Dates |
LSWR T9 | London Waterloo - Plymouth* | 64 | 1899-1963 |
GWR Iron Duke/ Rover† | Great Western | 45 | 1847-92 |
GWR Castle Class | Great Western | 41 | 1923-64 |
LNER A1/A3 | East Coast Main Line | 41 | 1922-63 |
Class 86 | West Coast Main Line | 38 | 1965-2003 |
Class 47 | Cross Country | 37 | 1965-2002 |
Class 91 | East Coast Main Line (to Leeds) | 33 (as of 2022) | 1989-present |
Class 45 | Midland Main Line | 29 | 1960-89 |
Class 33 | London Waterloo - Weymouth | ?? (25 ish?) | Early '60s to late '80s? |
Class 47 | Great Eastern Main Line (London- Norwich) | 22 | 1965-87 |
Class 55 'Deltic' | East Coast Main Line | 21 | 1961-82 |
*Debatable if LSWR route to Plymouth is a main line or not.
† Rover Class was upgrade of the Iron Dukes. If counted as a separate class the original Iron Dukes only worked 1847-84 (37 years)