Regardless of that, I don't think the comments above about the frictional forces being along the rail and so no work being done are correct.
They are conceptually correct for idealised/theoretical rigid smooth bodies, but in that case there wouldn't be any friction. Friction is caused by either/both:-
- the fact that at the microscopic level neither the rail nor the wheel are smooth, and
- constant making and breaking of electromagnetic bonds between rail and wheel,
both of which result in forces which disturb both surfaces at a molecular level causing the atoms to move quicker and so increase temerature.
More practically, we all know that friction causes heat. For example the friction from wheel slip can melt rails.
Finally, a coasting train will be creating negligible amounts of friction, but it will be compressing the rail and the resulting (plastic) deformation of the rail will generate some heat even if friction is ignored. How much, I have no idea.