As far as I know, there's no such public resource which actually gets it right all the time.
Most tools which attempt to do this will try to guess it from the stops and the shortest distances, but they do sometimes get it wrong. Even very detailed sites like https://carto.tchoo.net don't always know (as far as I know it only shows currently running trains anyway, so not suitable for your use case anyway, unless you check it at the same time your train was running, but on a different date).
Other sites (search for the same itinerary on a different date) include:
- Google Maps
- The CFF/SBB website
Note that:
- Trains do not necessarily take the geographically shortest itinerary. The best illustration is TGVs to/from Paris Gare de Lyon, which use the geographically longer Ligne de Villeneuve-Saint-Georges à la bifurcation de Moisenay (LGV) because it's actually faster, since it's a high-speed line.
- Some trains on apparently very similar itineraries may take very different routes. Trains between Chambéry and Paris may for instance either go via Aix-les-Bains and Bourg-en-Bresse or via La Tour-du-Pin.
- Trains from Toulouse to Paris may go via Bordeaux (TGVs) or the terrible POLT line (classic trains and night trains, I believe). They get to different stations in Paris though.
- Trains between Paris and Bordeaux (and beyond) may either stay on the high-speed line all along or switch back and forth between the high-speed and classic lines to serve intermediate stations like Poitiers or Angoulême.
- In case of disruption, trains can be re-routed via quite different paths. The most common case is re-routing of TGVs onto the "classic line" when there's a problem on the high-speed line. There are a few other alternative routings here and there (not that many, though), like the bypass via the Grande Ceinture Stratégique, or sending a train to a different station in Paris (via the Interconnexion Est).
If you want a detailed map of the tracks (not the actual or even imagined train itineraries):
If you tell us which train you took (and the date) there's a good chance someone would be able to tell you the route it took.