The mid-point of line joining points whose position vectors are $a$ and $b$ is $M\left(\frac{a+ b}{2}\right)$ and the direction ratio vector of line joining of given points is $(a-b)$
Let a variable point $p(r)$ on the perpendicular bisector of $A B$, so $M P \perp B A$
$\Rightarrow \left(r-\frac{a+ b}{2}\right) \cdot(a-b)=0$
$\Rightarrow (2 r-a-b) \cdot(a-b)=0$