From the Super Mario Wiki
Midway Gates are checkpoints near the middle of any level in Super Mario World. They appear as two blue-white-striped posts, linked by a white bar, thus looking like smaller versions of the Giant Gates in the same game. When Mario or Luigi pass through, the bar will disappear. This has basically two effects: First, the Gate serves as a save point. If the player loses a life in a level of which he had cut the Midway Gate bar before, he will restart just at the midway point. Second, if Mario or Luigi cuts the bar when being in their small form, they will turn into Super Mario and Super Luigi, respectively. When restarting at the Midway Gate, the bar will be missing, though.