Deriving long-run cost function
You're right. Divide Eq (1) by Eq (2):

$$
\frac{a L^{a-1}K^b}{bL^aK^{b-1}} = \frac{aK}{bL} = \frac{w}{r} ~~~\Rightarrow~~~ L = \frac{ar}{bw}K \tag{4}
$$

Now use this in Eq. (3)

$$
C = wL + rK = \left(\frac{a}{b} + 1\right)rK ~~~\Rightarrow~~~ K = \frac{C}{r(a/b + 1)} \tag{5}
$$

Replace this in Eq. (4) to get $L$