There are several training principles which athletes and coaches must try to satisfy if their training plans are to get the best results.
In relation to this question, the principle is one of specificity. Thus, the simple answer is that it is not particularly important to train on the hills if one’s race has little elevation. That will definitely be music to the ears of those who live in the flatter areas of the world. Having said that, if you are able to incorporate hills into your training, you can build strength which will be useful in flatter races.
For ‘flat’ races the optimal approach is to maintain an even cadence and aero position, and adopt a balanced pacing strategy. Training on flat terrain provides a perfect opportunity to perfect all three of these. The addition of hills will help the rider to develop additional strength, which then allows them to push a slightly larger gear for longer.