(I read the question title "Munich from Rome" and therefore this is a northbound description, but the route should by symmetrical in the opposite direction)
You can't do this entirely by train avoiding long tunnels, but you can take a combination of trains and buses, essentially take trains to the foot of the Alps, buses across the big passes, then get on the train again on the other side. This will be much easier in summer than in winter, as most passes are closed in winter. In either case it will require extensive planning, a long time, will probably cost more, and will give you lots of scenic views.
Via the Bernina Railway
Train Milano–Scuol (6 hours), bus Scuol–Landeck (1½ hour), train Landeck–Munich (3 hours). Three tunnels >1500 metre, longest tunnel 2350 metre.
The only railway that crosses from the Italian side to the German side of the Alps without a big tunnel is the Bernina railway connecting Tirano (Lombardia, Italy) to St. Moritz (Graubünden, Switzerland). The longest tunnel on this railway is 689 metre and it runs year round. You can get from Milano to Tirano via Lecco and Sondrio along the Tirano-Lecco railway which
does not appear to have any major tunnels has tunnels, but there are alternate routes without, see jcarons answer.
From St. Moritz, you can take the train to Scuol. This section has 16 tunnels, including 3 that are longer than 500 metre, all along the 9 km between Guarda and Ftan. The longest is 2350 metre. You might be able to avoid them by switching to a bus at this section.
The railway ends in Scuol, from here you'll need to switch to a bus to Austria, where the railway continues from Landeck. The shortest and fastest car route between the two places is tunnel free.
From Landeck, you can continue by train. To get to Innsbruck along the Arlberg railway, there are two tunnels. The longest, the Zammer tunnel, is 2335 m and is immediately east of Landeck. Again, you might be able to avoid it by bus.
From Innsbruck, there is a scenic railway to Garmich-Partenkirchen, bu the Mittenwald Railway does have 16 tunnels, including 2 that are longer than 500 metre, the longest being 1810 metre. From GAP you have reached the north side of the Alps and can continue by train easily. Direct trains avoiding this route now anyway take the New Lower Inn Valley railway which is mostly built in tunnels, but local trains via Rosenheim might take the old mostly tunnel-free track — check this carefully. From Rosenheim it's easy to reach Munich.
Bus Airolo - Göschenen (summer only)
Alternately, you can take a train to Airolo, then take a bus over the summit of the pass to Göschenen (summer only), and get back on the train from there, having reached the northern side. Be careful in your planning, most buses take a tunnel. There are still tunnels on the connecting tracks, so you'd have to see if you can handle those or if you can avoid them with a bus.
Bus Domodossola - Brig
You might find a year-round alternative by taking the train to Domodossola, a bus over the Simplon Pass, then a train from Brig via Martigny to Basel. You will probably have to make some extra changes and detours in northern Switzerland to avoid further tunnels.
If even short tunnels are not an option due to claustrophobia, then taking the train is probably not a realistic alternative. Even roads will have short tunnels. You may be able to find a route by road that avoids any short tunnels, making big detours where they do happen, but it would be a long journey.
The truly touristic outdoor alternative
Take a train to as close to the Alps as you can get, hike over the Alps, then get onto a train again on the other side ;-) Or walk in little segments, get off the train at the last station before the tunnel, have a hike until the other side of the tunnel, get on the next or next next train. This suggestion is not entirely serious but if you make it a fun week in summer it could be a nice backpacking vacation :)
From Rome to the foot of the Alps…
I did not cover in this answer the trains from Rome to (for example) Milano. I remember the fast trains having lots of tunnels. I did not take the slow train. You've talked about length, but consider: at 240 km/h, a 2 km tunnel will take 30 seconds to cross. Is it the length or the duration that triggers claustrophobia? For your specific route, look up the Wikipedia articles describing the railway section. On the right, unfold the section where it says "Route map". This often mentions all tunnels, certainly if they are longer than a few hundred metre. You can also follow the track on Openstreetmap, Google Maps, or Google Earth and look for tunnels that way. Only you can finally judge what is acceptable for you or not. Good luck!