Answer:
They both end up with the same speed.
Step-by-step explanation:
Mechanical Energy
The total mechanical energy of a body is defined as the sum of its kinetic and potential energies.

In a system where no friction force is considered, the mechanical energy is conserved, which means the changes in kinetic energy are compensated by changes in potential energy and vice-versa.
The kinetic energy can be expressed as

And the potential energy is

Thus the mechanical energy is

Note that the kinetic energy depends on the square of the speed regardless of its direction, which means it's always a positive quantity. The first roller coaster is moving downwards at 5 m/s, which means its kinetic energy is

When it goes down, it loses height and gains speed or kinetic energy by an amount of

So the new kinetic energy is


Since

Solving for


Now, let's consider the second roller coaster with an initial speed of 5 m/s uphill. In terms of energy, it's exactly the same situation as before. This object's mechanical energy is the same as the other one, so the final speed will also be the same. But we'll elaborate more.
The second roller coaster goes uphill, then stops and then returns to the very same point as it was at the very same speed as before, but downhill. It means it will behave exactly like the first roller coaster, but a little later.
Conclusion: they both end up with the same speed