I'm not sure whether it's law or just individual company policy that states a job has to be advertised internally. I know where I work, the policy is to advertise permanent posts externally and internally at the same time. Temporary positions can just be slotted into following an 'expression of interest' and, sometimes, an interview.
I guess you won't know if the 'successful' candidate was fairly recruited or not and I would suggest you contact someone like ACAS if you feel have decent evidence for the latter. Aside from that, take comfort in the fact that you all had the same length of time to prepare and, hopefully, the interview panel will take account of that.