Math isn't quite right here since you spend more time going up hill. for a 15 km hill, you would spend an hour going up it, and .43 hours doing down it, with an average speed of 30km/1.43 hours = 20 kph.
When I was using a direct drive motor, my speed up hill was faster, down hill was slower...