Using your road running shoes for trail running typically does not pose too much of a problem. Most road shoes, even though they may have a sleek and lightweight design, can hold up well on the trails. The major differences between road shoes and trail shoes are the bottoms of the shoes and the amount of padding, cushioning, and support. Trail shoes have rugged edges along the bottom that help runners grip the ground beneath them. Because running on trails and non-paved roads outside can mean running across uneven surfaces and braving gravel, dirt, mud, mulch, grass, and a myriad of other terrain coverings, there is a higher risk that you will slip or lose your balance and fall, possibly injuring yourself in the process. Running shoes obviously do not have this kind of grip because, if you run on a flat surface, the feeling of edges and "grippy" rubber on the bottom of your feet would not be very comfortable and would likely throw off your balance and foot strike.
I would say that it is probably a safer bet and better idea to run a trail race in road shoes than it is to run a road race in trail shoes. Trail shoes can be extremely heavy compared to road shoes, and have added layers of soft cushioning surrounding the foot to protect from debris and other stuff you might come across on the trails. If you were to wear these on the roads, though, you might find yourself lamenting the added and unnecessary weight - especially near the end of your race when your legs are already feeling heavy and you are struggling to push it up a huge hill. The real risk you run (no pun intended) in wearing your road shoes for your trail race is the lack of grip on the bottoms of your shoes. But as long as you are keeping your head down and are mindful and aware of what is in front of you, you will probably be fine navigating the trails in road shoes.
However, if you find yourself totally in love with trail running and trail races, and want to switch up your training to focus exclusively or more on trail running than road running, it would certainly be worth considering a purchase of a good pair of trail shoes. The extra weight, cushioning, and the unique soles might take a bit of time adjusting to, but once you are used to them, I think you will find them quite helpful for the trails!