We are working in the frame of the cart and we are trying to obtain the $\tau=k\theta$ form.
So, let's write the $\tau=I_{axis}\alpha$ first for a small deviation $\theta$ from the vartical.
(The moment of inertia of the bob about the point of suspension would approximately be equal to $ml^2$ as the bob is small.)
Thus,
$mgl\sin\theta - mal\cos\theta=ml^2\alpha$
As $\theta$ is small, $$gl\theta-al=l^2 \alpha$$
Solving this would give $T=2π\sqrt{\frac{l}{g}}$ and not $T=2π\sqrt{\frac{l}{g_{eff}}}$
What am I doing wrong?