I was just wondering how this is possible, there are some 50+ year old people who are 'Dr. X Y', and others who are maybe "only" 40 years old , but they are 'Professor Dr. X Y'.
In a colloquial sense, may simply refer to a group of educators/teachers at a university/colleges. However, in more strict sense, the formal designation of Professor is generally obtained by rising through the ranks. You can find lots of details regarding how this system works out, and even some technicalities, in this link. (N.B. US-specific, but generalizable to some extent.) Quoting verbatim from the article:
Educators who hold a formal title of "Professor" (referred to as tenured/tenure-track faculty) typically begin their careers as assistant professors, (or "lecturers" and "senior lecturers") with subsequent promotions to the ranks of associate professor and finally professor. The titles are historical traditions; for example, it is not implied that an assistant professor "assists" more senior faculty. There is often a strict timeline for application for promotion from assistant to associate professor, most often 5 or 6 years following the initial appointment. Applicants are evaluated based on their contributions to research, teaching, and administration. The relative weightings of these contributions differ by institution, with PhD-granting universities usually placing more emphasis on research and liberal arts colleges placing more emphasis on teaching.
Now, until one has risen through the ranks to formally hold this title of professor, technically that guy can't/shouldn't use the title "Prof." in front of his/her name. But, if he/she holds a Ph.D. (i.e. Doctor of Philosophy) degree, "Dr." can be used as a prefix before the name. Later in the career, when this person becomes a formal Professor, he is free to replace that "Dr." by "Prof." (or rarely, even use both at once.)
Also, while there may be correlations between age and rank, there is absolutely no reason why a more aged person can not be academically junior to a younger person who might have made it further in the hierarchy. It all depends on satisfying the requisite criterion (see linked article). This explains you observation:
there are some 50+ year old people who are 'Dr. X Y', and others who are maybe "only" 40 years old , but they are 'Professor Dr. X Y'
Hope that helps :)
It is possible that some older Drs may not want to be profs. As an academic rises through the ranks, their duties tend to migrate from active teaching and research into more of a managerial role, which doesn't suit everybody (and the activities that merit your promotion do not necessarily imply you have the abilities required to flourish in the role into which you find yourself promoted).