Think about it this way. The scanner has a resolution of 4000 PPI, So in order to image a 2.25" wide piece of film, the sensor has 2.25*4000 = 9000 pixels across the width of the film
. This is the dimension parallel to the line sensor. If you're scanning a 645 frame, then the sensor only moves 45mm (1.75") along the length of the roll. So your final resolution is 9000 (across the width of the film) x 7000 (1.75" *4000 along the length of the film). A 6x6 frame gets you a 9000 x 9000 image, and a 6x9 (3.25" long) gets you 9000 x 13000. This is because the width dimension is fixed by the optical properties of the sensor, and the other dimension is dictated by how far the scanner head moves while scanning.
Similarly for 35mm. The width of a frame on a 35mm film strip is 24mm (we'll call this 1 inch). So only about 4000 of the 9000 pixels in the width direction contain useful image data. Now our resolution is still 4000 PPI, because nothing in the optical system has changed just by putting in a different film carrier. The sensor travels the 36mm along the length of the roll (~1.5 inches), so you end up with a image that is 4000x6000.
The slide carrier orients the film differently than the 35mm strip holder, but it doesn't matter. Here the 36mm dimension (~1.5 inches) is parallel to the sensor, so we're using 6000 of the 9000 pixels in that dimension. But the sensor only travels 24mm (~1 inch), capturing 4000 pixels in that dimension. You end up with the same 6000x4000 pixel image.