In Fig. (a), −q is in stable equilibrium
In Fig. (a), −q is in neutral equilibrium
In Fig. (b), −q is in stable equilibrium
Neither in fig (a) nor in fig (b) −q is in stable equilibrium
In figure 1, charge -q is in unstable equilibrium because if it is pulled down the electrostatic force is lesser than the downward gravitational pull and hence it will accelerate downward. Now in other case If charge -q is displaced upward then it will come down due to gravitational force and if it is pulled downward then also it will tend to move to its original position hence it is the case of stable equilibrium.