For booking train tickets with Thai Railways, a passport number is typically required as it is used to identify you and confirm your nationality.
If you have changed your passport after purchasing a train ticket and the old passport number was provided during the booking process, it is advisable to bring both your old and new passports when boarding the train. This way, the ticket inspector can verify your identity and ensure that your ticket matches the correct passport information.
To avoid complications, it's best to ensure that you enter the correct passport number when booking.