Of course, any answer makes the assumption that both hands make it to the river. In the linked video below, if the players with AA had raised pre-flop and the player with KJ of diamonds had folded, the whole calculation would have been moot.
"The chances of a royal flush and quads happening in the same hand: 1 in 2.7 billion", according to Lon McEachern.
I assumed the guys over at ESPN have done the math, but after viewing the link to discussion there was some concern about whether they did the math correctly so I decided to do it myself based on both the outcome stated in the video and this actual question, both of which ask about seeing both a royal flush and quads in the same hand.
I am going to work backwards from the end result. The first thing to consider is that there are actually two ways this can happen. One is for the player with quads to have any pocket pair tens or higher. The second is for the player with quads to only have one card 10 or higher which forms the quads.
Let's start with the first possibility, as it is both the easiest, and will never result in a chopped pot.
The probability p of having a specific pocket pair is 1/221. Now the board must have the same pair, and at least 2 of the remaining broadway cards, suited. There are two ways that this can happen: there can either by exactly 2, or there can be 3. Again, let's just consider the first case right now as this is the easiest.
There are 1,712,304 possible ways to deal the board. (48 choose 5) There are 5 different pocket pairs for the quads (AA, KK, QQ, JJ, 10 10) and each of these has four remaining broadway cards of which two must show on the board. There are 6 ways that two of the four can show. Since there are four suits there are four ways these combinations can fall.
So for a given pocket pair, out of the 1,712,304 possible ways to deal the board, 1120 of them will meet the above criterion. (6 broadway combinations * 4 suits * 46 ways the remaining card can fall). But the other player must have the two specific cards to complete the royal flush and the probability of that happening is 1/45 * 1/44 = 1/1980.
So for a given pocket pair 10 or above, the combined probability is 1/221 * 1120/1712304 * 1/1980 = 7/4,682,937,402. So for pocket aces the chance is about 1 in 669 million.
For all 5 pocket pairs the probability is 35/4,682,937,402 or about 1 in 133 million.
So I'm not sure where ESPN got their numbers, but it's definitely more likely than they say.
The above doesn't even count the case where the last card on the board is also a broadway card of the same suit (maybe a 4 to the royal flush on the board) nor the case where there are three of a kind on the board matching one of the player's hole cards. These two will only increase the probability of seeing both quads and a royal flush in a hand. These are more work to calculate and I will try to do this later when I have time.