Need to be clear on this as theres a lot of bad assumptions below
The best answer is not a standard 'tax' but a payment that is required when land surrounding new transit is redeveloped to higher density. This is the clearest, cleanest solution. Homeowners dont have to pay if they stay and developers just factor the cost in when buying property which removes the problem of money just ending up with existing landowners when they sell the land.
This idea has been around for a long time but not widely implemented in the west yet because the politics is hard. Whichever country does it first will have a massive head start for the future imo