Rough estimate of distance of tip of derailleur cage from axle center:
I assume top pulley wheel is just touching sprocket, and pulley centers lie on a radius line from wheel axle center.
The radius through chain pin centers of a sprocket is approximated by n * s / 2 pi. n is number of teeth, s is chain pitch: 12.75mm in this case (see here).
Add say 5mm to pin center radius to get approximate total radius of sprocket.
40 teeth: 86mm
42 teeth: 90mm
46 teeth: 98mm
XTR RD-M9000 derailleurs have 11 tooth pulleys (I think)
11 teeth: 27mm
The distance of the tip of the lower pulley wheel from the wheel axle center is sprocket radius + (2 * pulley radius) + cage pulley center to pulley center distance.
Guessing the pulley center to pulley center distance is 80mm:
40 teeth: 220mm
42 teeth: 224mm
46 teeth: 232mm
How much clearance between the axle center and road do you have? An ETRTO 406 rim is obviously 203mm radius, plus say 25mm tire depth for a 35mm wide tire: 228mm.
There are plenty of 20" wheel folding bikes with derailleurs available, but I assume these use ~30 tooth largest sprockets. Browsing through google images of folding bikes I see their derailleur cages are very close to the ground anyway.