In the very short term (the following few days) and assuming no civil unrest, there will be no impact on the railway. This probably goes for the short term of the following few weeks as well. As I understand it, most railway staff are on long term or permanent contracts so there will be no immediate impact from it not being so easy to employ European staff.
It's as time passes that there might be some impact. As has been noted above, roads near ports may become congested as customs clearance in and out of the UK becomes time consuming: this may impact on the demand for train travel nearby. But there may be a bigger (and more relevantly an unpredictable) impact from train failures: my understanding is that a lot of modern trains use European parts, and thinned out parts stores mean that a parts failure means getting a new part from the (overseas) manufacturer rather than a local warehouse. Trains will be out of use awaiting repair for longer than we are used to. The railway will suffer the secondary delays that all British industry will face.
In the long term, given that the railway is a service industry, Brexit's impact will mainly be as a consequence of how the economy as a whole responds. There will also be ongoing problems in obtaining parts (see above) or alternatively needing revenue to be tied up in inventory, and with a reduced pool of potential employees (no more Europeans) we can anticipate higher staffing costs. Railways will have to increase their income to cover their increased costs: in other words, fares will go up.
I don't expect many firms (whether railway or otherwise) to collapse on Brexit-day + 1. But I do expect a lot of firms to be struggling and failing in Brexit + a year or two.