When I was on ER, it was quite noticeable that the GD passenger engines were filthier (inside and out) than their counterparts at Haymarket and Finsbury Park.
The answer was that the staffing available to do cleaning differed by depot. Occasionally the Newcastle Division would ask us in the KX Division how many staff we employed on cleaning duties and it was always a much, much higher figure at KX/FP. Gateshead, apparently, really struggled to fill these posts as there was better paid work for unskilled labour elsewhere in Newcastle and, as a result, unfilled posts were always prone to being periodically abolished. They would then try and build a case to recruit more staff as a result of knowing our figures.
The time on each depot wasn't really a factor - it was the staff availability that was key. There was also a very clear and long established regime at KX that locomotives had, when possible, to be kept clean so the resources were provided to help the depots achieve that requirement.