The aircraft are flying at the same speed… What type of speed?
If both aircraft had the same ground speed throughout the flight, then the lower altitude plane would win, because it would have a slightly shorter distance to cover (see Fred K’s answer)
If both aircraft had the same indicated airspeed, then the high altitude plane would win, because it is actually flying much faster than the low altitude plane.
If both aircraft had the same true airspeed, then the winner would depend on the wind conditions at altitude. A tailwind throughout most of the flight would make the high altitude plane win, and a high headwind would make it lose.