My question is why it takes so much longer to build the BVH when you are doing the real render than when you set the viewport to render.
probably because in the viewport is constantly cached, instead when rendering it’s rebuilded from scratch.
Because of Surface Subdivision modifier have different settings for preview and final model, final model have much more triangles and take more time to preprocess BVH.
Under the Performance rollout you can check Cache BVH. This does not rebuild the BVH on a final render unless you have changed gemoetry.