The most budget-friendly option (and also the kindest to our planet :-) ) is the daytime train. The overnight train is way overpriced. Plus, the daytime train lets you enjoy the scenery.
A Cairo-Luxor ticket costs 200 EGP (~10 €) in 1st class and 120 EGP (~6 €) in 2nd class air-conditioned.
However, ticket counters at Cairo station often refuse to sell tickets for trains other than the overnight one, claiming tourists are only allowed that train. But you can easily buy your ticket yourself via
https://enr.gov.eg (there’s a link to switch to English). You book, pay online, and print your ticket. The system is clearly designed for foreigners too, since you enter your nationality. No issues on board with this ticket—I tested it last November.
Last option: board the train without a ticket and catch the conductor as soon as they pass to buy one on the spot. You’ll just pay a small extra fee for buying it onboard. I’ve seen tourists do this without any problems.
The best train is the express 980, which leaves Cairo at 8:00 AM and arrives in Luxor at 6:15 PM. All schedules are available here.