In order to enter Midgar, one must pass through the railways that are built around the central pillars of each secter. The trains pass through multiple security checkpoints where the ID of every passenger is examined, and are run through the Midgar central database. The computers instantly determine if a person is a passenger, or terrorist against the Shinra. The trains are equipped with automatic locking blast doors that hold against even the strongest attacks, holding the enemies of the Shinra inside until they can be properly disposed of.
The train stations themselves have armed guards monitoring all who pass through, and armed AI controlled units guard the tunnels themselves, lest someone break in through the sewers or some other way. The ID checkpoints are changed daily, making a stolen or false pass worthless for passing through. Also, the tunnels, train, and checkpoints have remote turrets that fire at anyone who has been identified as an intruder.