I don't know how the measurements are calculated, but subjectively there is a lot more room in the Q7.
I was looking at both the Q5 and 7 and ended up buying the 7, one of the reasons was rear seat as well as cargo room.
My methodology for both cars was to get in and adjust the drivers seat to my driving position, (I'm 5ft 11)and then get in the back seat. There was at least 2-3 inches more space in the 7 when I did this.
2011 Q7 3.0T S-Line Prestige Daytona Gray/Black, S-Line Interior, Heated Rear Seats, Tow Package