A couple of points.
1. Address it Dear Sir (or actual name if you have one)
2. Quote the reference number you have been given. It will let the office tie up your response with their letter.
3. They will not be interested in your sob story - they have heard it all before. Concentrate on convincing them that you now realise what you did was wrong, you have learnt your lesson, and you will not do it again.
4. If you are not travelling in the morning peak, consider whether it will be worth your while buying a Railcard which gives you 1/3rd of the ticket price. If you do, state this in your letter so that it gives additional proof that you do not intend buying an incorrect ticket again.
https://www.nationalrail.co.uk/railcards/
5. Break your response into paragarphs - it makes it easier to read for someone who will be reading 100s of these letters each day.
I have made some adjustments to your letter below - you will need to make further adjustments to make sure it refects the actual facts. The letter below is a start, but you need to add something about realising the impact of fare evasion on railway companies and what you have learned from this incident. Also, if you have bought a railcard, say that.
Dear Sir,
Ref XXXXXXX
I refer to (date) xxxxx when I travelled from XXXXX to XXXX without a valid ticket. I now realise that this was a foolish idea, have now fully realised my fault, and will not do it again. I am terribly sorry for the inconvenience that has caused to your administration and I'm ashamed of what I’ve done.
xxxxxxxxx - what I have learned etc
I would be grateful if you would consider settling this out of Court, with an appropriate compensation for your administrative costs and owed fares. This is the first time I have done this, and will not do it again. I have been lawful in the past its only this time I've made this foolish decision.
Yours faithfully,
XXXXXX