The situation of the extra electrons in the magnesium bar is different of a bar with an excess of electrons due to friction for example. In this second case, any connection with the earth tends to neutralize the bar.
But the system magnesium bar + electrolyte must be taken as a whole. The excess of electrons in the bar are not free only because they are far from the positive ions in the solution. So, connecting it to the earth is like breaking the glass of an aquarium with coral reefs and fishes, connecting it to the ocean. The fishes have nothing to actract them out from its source of food.
The same happens if the bars are connected without also connecting the solutions. We can not think of the electrons in each bar forggeting its
interactions with the ions.
Only after bars and solutions are connected we have another system, composed by the bars and the electrolyte, and a system out of equilibrium while the chemical reaction is running.
Because the spheres are made of metal, electrons are free to flow between them. So when the rod containing positive charge is brought close to the spheres, the electrons within the two-sphere system will move toward the rod.
This means there will be a migration of electrons from sphere B to sphere A (assuming sphere A is closest to the rod). This will cause the two spheres to be polarized as they are in contact (but the whole two-sphere system is still electrically neutral). But each individual sphere, will have a net charge. Sphere B will have a net positive charge while sphere A will have a net negative charge. When sphere B is moved away from sphere A the positive charge will redistribute itself uniformly about sphere B, and therefore there will be net negative charge uniformly distributed around sphere A. Sphere A attracts the rod.
It's not clear to me, by the way, if they mean that we bring the rod close, remove sphere B, and then repeat the procedure with sphere B absent. Or just repeat the entire procedure, with sphere B present again
It means the process is repeated with a negatively charged rod. The same will happen but with opposite net charge on each sphere. That is, there will be net positive charge on sphere A and negative charge on B. Sphere A attracts the rod.
all we should expect is a temporary charge separation. After which the sphere, being removed, wouldn't affect anything.
As written above, since the charged rod polarizes both spheres, removing one sphere results in net opposite signed charge on either sphere.
This answer doesn't make sense to me due to the fact that the rod doesn't come into direct contact with either sphere.
As written above, it makes sense that the rod is brought near to the spheres and not in contact, since charge is free to move on the spheres, all we need is polarization of charge. In fact, if the rod did make contact, there would be charge flow, which will result in equilibrium (equal charge on each sphere).
A. The rod induces charge separation, so sphere A gains a charge opposite that of the rod. Removing B, sphere A retains that charge and is therefore attracted to the rod in both cases.
This is obviously the correct answer, as we have seen in the analysis above.
Best Answer
This is an edited answer following the remark by Qmechanic pointing out that the capacitance used in the original answer assumes electrical contact between the spheres. Here I assume that the actual contact time is very small, so no discharge occurs. On, the other hand it is assumed that the motion is slow enough that the laws of electrostatics apply. The capacitance formulas are taken from the article: "Capacitance coefficients of two spheres" by John Lekner. The same notation is used, where the charged sphere is denoted with the subscript $a$ and the other sphere with the subscript $b$. Also CGS units are used (The capacitance has units of length).
Substituting $ Q_a = Q$, $Q_b = 0$, we obtain the following formula for the effective capacitance:
$$ C_s \equiv \frac{V_a}{Q} = \frac{C_{aa}C_{bb}-C_{ab}^2}{C_{bb}},$$
where $s$ is the separation distance. The expressions for the capacitance matrix elements at infinite separations $s=\infty$ are given in the text eq. (8) resulting the following result:
$$ C_{\infty} = R.$$
Of course, this is just the capacitance of the charged sphere.
The capacitance matrix elements become singular when the spheres approach contact $s\to 0$, but using the asymptotic formulas (16)-(18), the effective capacitance has a well defined limit:
$$C_0 = \lim_{u \to 0}\frac{R}{2} \frac{(\ln(\frac{2}{u})-\psi(\frac{1}{2}))^2-(\ln(\frac{2}{u})+\gamma)^2}{(\ln(\frac{2}{u})-\psi(\frac{1}{2}))}= -R (\psi(\frac{1}{2})+\gamma) = 2 R \ln 2,$$
where $\gamma$ is the Euler constant and $\psi$ is the digamma function, and the following identity was used
$$\gamma +\psi(\frac{1}{2}) = -2 \ln 2.$$
By energy conservation
$$2 \frac{m v^2}{2} + \frac{Q^2}{C_0}= \frac{Q^2}{C_{\infty}}.$$
We obtain:
$$v = \sqrt{\frac{Q^2 (2\ln 2-1)}{2m R \ln 2}},$$
which is the speed just after collision in the case of an elastic collision. Of course, the speed is zero in the case (b) of inelastic collision.