It's tough to give an "objective" answer to this, but I was in the same scenario 5 years ago and went with a CX bike and have no regrets.
I always advise newbies to non-mountain biking (e.g. you're new to pavement commuting, road biking, racing, touring, gravel road biking, etc.) to at least consider a CX bike.
Here are some thoughts:
Road bikes tend to be very specifically tailored to road cycling, with lightweight (i.e. less durable components), and an aggresive (i.e. "hunched over" riding position that while great for racing is not so hot for almost all other pursuits (commuting, touring, etc.).
CX bikes, at least at the entry level (think aluminum frame, carbon fork, low to mid-range components) tend to have a more upright position that's a lot easier to get used to if you're coming from mountain/hybrid bikes. They also tend to have more heavy duty components, e.g. wheels with more spokes, etc., and the aluminum frame ones will often include mounting points for racks, fenders, etc., which road bikes tend not to.
As such, a CX bike can be a bit of a jack of all trades, letting you try out various types of road riding:
- Want to try gravel racing? You've got the tire clearance for fatter knobby tires. I just put 42mm tires on my CX bike; that's not gonna happen on a true road bike.
- Want to try racing in a local race or time trial? Put some skinny slicks on it, take off the fenders/racks, you've got a reasonable road machine. You're not going to win any races, but you're also not going to get laughed out of the race. I spend a lot of time riding pavement with 28C Gatorskins on mine.
- Want to try some light duty touring? If you go with a ALU frame CX bike with fender attachment points, you can throw a rack and fenders on and go for a few days tour. I did a 135km ride last year on my CX bike with 60 pounds of gear on it.
Ultimately, I've found my CX bike to be a real swiss army knife and it's allowed me to experiment with a lot more different types of riding than I think I could have if I'd gone with a dedicated road bike.
In the end you should test ride both bikes, a couple times if the first rides aren't conclusive, and see what you like the feel of better.
Also, quick caveat: in the time since I bought my bike, spinoffs of road racing have been proliferating and manufacturers are putting out more and more high end bikes within those niches (e.g. high end all-carbon CX bikes or gravel bikes), and like a dedicated road bike, those will not be as multi-purpose as an entry level CX bike would be. E.g. if you look at a high end CX bike, it will probably be all-carbon, with no fender/rack mounting, so will not offer much in the way of touring capabilities.
Hope that helps!