Aircraft fuel isn't taxed, but train 'fuel' (electric or diesel) is taxed.
Airlines can base their staff in a cheap country and pay lower wages, avoid unions etc.
Local governments subsidise airports to attract tourists/business. The railway already exists and doesn't get this subsidy.
For example, I wouldn't consider taking a flight from Copenhagen to Århus (40 minutes vs 2¼ hrs) as the saving is wasted on waiting, and flying is much less comfortable.
(That's an extreme example for the distance, as it crosses a sea.)
It's certainly a competitor, but definitely not the preferred option.
Only for very specific routes. If I want go to from here to the one of the maybe 4 closest large cities, I'm definitely taking the train. If I want to to go from here to just about any other major city in Europe flying is almost always much faster. A bunch of people from work where going to a conference in Amsterdam a few years ago and some of them wanted to take the train for environmental reasons, and the train was literally 20+ hours door to door from the midsized European city I live in. Directly flights are under 2 hours.
Two hours flight time from Amsterdam is Italy or beyond, that's quite different.
But the train is much faster if you want to go from city center to city center for a distance that's a relatively short flight. Like London to Paris or Amsterdam to Frankfurt. If you want to go across Europe from one side to the other, the plane is much faster.