OK, I can't test in the sim until tonight, so maybe someone else could.
I did a back-of-the-envelope calculation:
if it takes us 2 min to get to 870 km/h TAS (from a standing start), at ground level, assuming an avg of 400 km/h TAS during those 2 minutes, and then start climbing as normal, the total distance taken is 44 km. So, it seems we can massage the numbers to fit into 40 km, if the 2 mins to take off and get to 870 km/h TAS is reasonable. I suspect it might not be.
But, I dunno if the sim can climb as steeply as this requires. Can someone test?