At temperature $T_0$, the pressure of the gas is $2L$ mmHg and its volume is $aL$ mm$^3$, where $a$ mm$^2$ is the cross-section area of the tube. Suppose that the temperature of the gas is $T$ when the volume $ax$ mm$^3$ of mercury has overflown off the tube. Then the pressure of the gas is $2L-x$ mmHg and its volume is $a(L+x)$ mm$^3$. From ideal gas law,
which has maximum value of $9T_0/8$, when $x=L/2$. Thus, the gas must be heated to at least this temperature in order for it to displace all the mercury in the tube.