The energy requirements are vastly different, rolling stock is a lot cheaper than airframes etc.
According to https://www.withouthotair.com/c20/page_121.shtml Trains are about 8.5x more energy efficient than planes. So yeah, trains win that too. For context, planes do about 80 MPG per passenger.
On the other hand, building HS2 might cost £75 billion. It might carry 100 trains per day, so 32000 passengers per day, if all the trains were full. That's 11.7M per year. If it runs for 25 years without costing anything more, that's 292M passenger journeys, so £256 per passenger journey.
I _think_ that demonstrates that the infrastructure costs are larger than the costs of extra energy requirements and airframes. But we're clearly into "it's complicated" territory, so I concede.