Seems like the rule is serving as an unofficial (and frankly illegal) town "drawbridge" to keep the riff-raff out.
Edit: to all the replies telling me how it couldn't possibly work because people will break the rules: which is also true of the current system? And gates are a thing, folks. So is automated enforcement?
If it's a private tunnel, nothing stops the railroad from saying "if you ignore the traffic control system, we fine you $x. If you do it again, you're barred from using the tunnel for a month and have a fine of $x*2. If you do it again, you're barred from using the tunnel permanently." Watch how fast people follow the rules.
https://dot.alaska.gov/creg/whittiertunnel/faq.shtml
Why is Whittier so important to the Alaska Railroad?
From an economic and geographic standpoint, Whittier represents the Alaska Railroad's only viable freight interchange point for its barge service connecting Alaska with the lower 48 states and Canada. Seward and Anchorage are not viable port alternatives for barge interline service. Anchorage is not free of ice year-round and Seward requires traveling over a mountain pass at a 3% grade (it would take six locomotives to haul a heavy load from Seward versus two from Whittier). Whittier is a year-round, ice-free, deep-water port. It is located only 50 miles from Anchorage and has slight grades for trains and engines. For these reasons, all the Alaska Railroad's railcars, locomotives, and rail-borne freight must enter and depart via Whittier.