Crossover from shear-driven to thermally activated drainage of liquid-infused microscale capillaries