Answer
Please see the work below.
Work Step by Step
Let the electric energy for the first charge be:
$U_1=q_1V_1$ and for the second charge:
$U_2=q_2V_2$
but given that $V_1=V_2=V$
$\implies U_1=q_1V$ and $U_2=q_2V$
Now, comparing these two equations, we have
$U_1=U_2$
$\implies q_1V=q_2V$
This simplifies to:
$q_1=q_2$
Thus, the electric potential energy for the two charges is the same if $q_1=q_2$, that is, if they are equal in magnitude.