This depends on the ROM of your choice. Some ROMs come pre-rooted while some will come unrooted and you’ll have to get root access manually with some root manager, like Magisk or SuperSU.
Most ‘official’ custom ROMs these days won’t come pre-rooted though, as they leave it on the user’s will. Some might want root, and others might not. That is why, most ROMs would just come unrooted, and given that you’ve already unlocked the bootloader before flashing the ROM, flashing the root manager and scripts shall be as easy as flashing an extra zip after flashing the ROM.
If you’re new to this, here’s a detailed guide to rooting your Android phone (ROM).