If a reference applies for the same position do they have a professional obligation to inform you that they are applying for that same job?
I am interpreting the question as: does someone who writes you a recommendation letter for academic position X and is themselves applying for academic position X have an obligation to inform you of this?
They certainly do not have a professional obligation. By that I mean that there is no rule that requires it. On the contrary a general principle of academic job processes is that when possible they should be kept confidential, so the information that someone is applying for academic jobs and if so what jobs need not be disclosed by them to anyone (except the institutions they apply to, obviously).
As usual, the question of ethical obligation is a bit more interesting. In my opinion the answer is still generally no: in most circumstances there is no ethical obligation to disclose this information.
I should clarify that in my part of academia both job applications and reference letters are done in "carpet bombing" style: many people who are applying to one academic job are applying to twenty or more, more commonly fifty or more, and not so rarely one hundred or more. Many of the letters are common to all 20, 50, or 100 jobs. Thus if the writer happens to be applying for a position at one of the same institutions -- and let me say that whether someone is applying for "the same position" is sometimes well-defined and sometimes a bit nebulous; people of very differing levels of seniority can be treated very differently by hiring committees, and it is not uncommon that in that situation if one really does want to hire both people then one tries to do so and sometimes succeeds -- it is not necessarily a direct conflict of interest. More specifically, I have occasionally seen an application by a letter writer for "the same position" that the letter writee has applied for, and the letter writer's application did not undercut their letter.
In my circle most letters of recommendation are general evaluations of the candidate that would be suitable across an entire range of institutions: they do not make a specific argument as to why Institution A should hire the candidate. In fact, in my field (mathematics) we have an extremely convenient automated job applications site (called, reasonably enough, MathJobs), so when someone asks me for a recommendation I don't even know the full list of places in which that recommendation is being used.
I have written dozens of recommendation letters for academic jobs. Exactly one was specifically targeted to one institution, the one job to which that person was applying. If I had also been applying for the same job: yes, that would have been awkward and ethically problematic.
As above, I would say that the ethical problem occurs when you are writing a letter which is targeted to a specific institution and you know at the time of writing that you plan to apply for the same job. Such a situation is the ne plus ultra of conflicts of interest, and the ethical thing to do would be to decline to write the recommendation for that institution. It is not necessary to disclose why, but if one is willing to write other strong recommendation letters it would be good to say so.
Finally, let me say that one can largely avoid this issue by making sure that your recommenders are much more senior than you. Thus, if you are applying for a postdoc position, have all your letter writers be on the tenure track. If you are applying for an assistant professor position, have all your letter writers be tenured. This turns out to be good advice anyway: senior people have more pull and, other things being equal or nearly equal, are the ones you want writing for you.