Electronic configuration of P is 2,8,8 and of Q is 2,8,6.
P has completely filled valence shell as it has 8 electrons in its outermost M shell. Q has 2 electrons less than a full octet. Elements with incompletely filled valence shell are reactive while ones with full octet are inert.
So, Q is more reactive than P