There have been two confirmed marathons in space, both conducted on treadmills.
Astronauts on the International Space Station (ISS) have daily exercise regimes to keep strong and save their muscles and bones from the deteriorating effects of weightlessness. Harnesses and straps on a treadmill and stationary bike keep them from floating away.
On April 16 2007, NASA astronaut Sunita Williams completed a virtual ‘Boston Marathon’ while orbiting Earth on the International Space Station. She was weighted down with the harness in an effort to simulate Earth’s gravity and ran a time of 4 hours 23 minutes 10 seconds. See this NASA story.
On 24 April 2016, British astronaut Tim Peake also ran a marathon on the International Space Station to coincide with the London Marathon weekend. Peake is reported to have been loaded with 70% of his body weight on Earth and ran a time of 3 hours 35 minutes 21 seconds. See this Guardian story.
Both astronauts ran with different harnesses under different loads so the times are difficult to compare.