Bilinear map + commitment
If you define $u$ as element of $G_1$, then you can't just use it in $G_2$ (in the first equation), like you did in your equation. Besides, you missed to state, if $u$ and $g$ are generators of those groups. The following holds:

$$e(u^a,g^{\frac{b}{a}}) = e(u,g)^b = e(u^b,g)$$

Anyway, you didn't do that in the actual question, where I don't really see the connection to your construction. Btw, how do A and B know that they are using the same value $r$? And then: How can the server relate anything $B$ sends to $m'$, if the server has no knowledge of $m'$ or a commitment to $m'$? So no, he can't. Because $m'$ is not used in your construction at all.

The question now is: What is your actual goal? Should the server just be able to make sure, A and B committed to the same value? And A and B have to interact to generate the witness for that? You don't need pairings for that.

edit: Maybe even Alice could cheat in the system, by not sending $g^a$ to Bob, but something else. What happens then? Well, if the server check returns true, the "commited" messages are not equal. Too many things that can go wrong, especially with that $r$, which doesn't make sense.