no clear answer as you need to nail down the specifics, small wheels spin up easier and are more areo, arnimal with their small wheels were banned from tt/velodrome cycling competition, then there is rolling resistance, size of contact patch and the surface you are riding on.
you are talking in mtb size so i would imagine the 29’er will be quicker over normal xc rolling terrain.
best way to find out is to try it.