One of the main reasons for the disparity is the lower taxes that the aviation industry benefits from.
If you fly from Paris to Barcelona the airline not only pays no VAT, but is also exempt from kerosene tax. If you make the same journey by train, the rail company will pay an energy tax and passenger VAT. This means higher costs for the company which are usually reflected in ticket prices.
Archived version: https://archive.ph/7Zrur
IMHO one of the main issue is the lack of integrated booking platform for trains. Especially for international routes. It is very easy to plan a travel by planes, because there is an interoperable platform across all companies and booking agents. For trains, this does not exist, and it prevent the fair and free competition between operators, which would probably reduce the prices overall.