The train tickets are around 25-35€ one way if you order them online, at least 1 month before departure.
Just use the right price portal.
https://ps.bahn.de/preissuche/preissuche/psc_start.post#stay
BUT these budget tickets are dedicated to a specific train connection at a specific time.
If you miss the train, the ticket can NOT be used for a different train, its NOT refundable (unless you use a flexi ticket, which is usually 25% more for the same connection).
Unless it was the fault of the train company (f.e. late arrival).
Also, coffee is around 0,80€-2€ per cup (normal, milk, sugar, not the hipster stuff).
Normal street food should be around 2-4€ if you dont eat right next to some tourist attraction.
Visit some small local restaurants instead of big chains.
Most food stalls provide much better quality and value for money than machdonalds, BK or kfc. Meaning, the sell actual food for around 50% of the price of processed "MC" plastic Stuff.
For around the same price as an overpriced, oversalted fat menu at MCD, you can get the comparatively expensive, but tasty indian street food or stuff from around the world.
Edit:
Sausages in bread are around 2-3€. Also, i ate like that when i visited different cities all over germany, and other parts of europe as a student.
Still eating the same today when traveling (except when i source local ingredients and cook them myself, which i really like).
not sure if other people only associate "expensive, upscale, long waiting time" with the term restaurant. I was reffering to smaller family restaurants and snack shop and stakeaways with seating.
Especially asian and chinese food (except indian) are really affordeable