If Earth and Mars were in the same orbit around the Sun, they would both be traveling at the same speed. The speed at which a planet orbits the Sun is determined by its distance from the Sun and the gravitational force acting upon it.
Kepler's Third Law of Planetary Motion states that the square of a planet's orbital period is directly proportional to the cube of its average distance from the Sun. This means that planets closer to the Sun have shorter orbital periods and travel at higher speeds compared to planets farther from the Sun.
Since Earth is closer to the Sun than Mars, it has a shorter orbital period and therefore travels at a higher speed. Earth completes one orbit around the Sun in approximately 365 days, while Mars takes about 687 Earth days to complete its orbit. Consequently, if Earth and Mars were in the same orbit, Earth would be faster, completing its orbit in less time than Mars.