Hello BatoolAbudahab
No. The railway is not responsible for the fact that your Schengen Visa got declined.
Purchasing tickets before you have the confirmation to come here was indeed not a wise decision.
All you can do is to resubmit a new visa application.
Kind regards,
Roland