I would have thought it would make sense to get the aircraft vacating the runway priority, so as to get him off the runway pronto. However, if the aircraft on the taxiway has a good head of steam built up, and runway occupancy is not an immediate problem, let that one go first.