$${(mg + T_1)l = T_2l \quad \Rightarrow\quad T_2 = T_1 + mg \underset{\Uparrow}{=} mg(\frac{2l - a}{2(a - l)} + 1) = \frac{mga}{2(a - l)}\\
T_1a = T_2(2l - a) \quad \Rightarrow\quad T_1 \overset{\Downarrow}{=} \frac{mg}{\frac{a}{2l - a} - 1} = \frac{mg(2l - a)}{2(a - l)}}$$