Minecraft wiki entry for Building_a_rollercoaster, associated text: Both water and lava will break any rail they come into contact with. (Water problem fixed in 1.17, but will slow down the minecart.) For maximum visual impact, you can construct a tunnel out of transparent blocks such as glass or barriers for moving through either of these fluids.