When is the best time to visit Denmark, Sweden and Norway via train
If you want fewer crowds but decent weather, early fall. We visited Denmark and Norway in September/October 2023. Too late for the beaches south of Copenhagen, and too early for cross-country skiing in Norway, but great for sightseeing in both countries. Oh, it did rain some of the time.
The quick, short and to the point recommendation would be something like May - September. But of course the world is much more nuanced than that. The big question is where you want to go and what kind of trip you want to have.
Popular cities, locations and attractions: You can feel the crowds in (mainly) July and August, but we're not plagued by overtourism to the same extent as you'll see in e.g. Venice and Amsterdam.
Rural communities, small islands, etc.: Some places have their tourism infrastructure shut down during the low season.
Scandinavia also cover a really large area. So obviously weather and (depending on the season) sunlight hours can vary drastically depending on where you go.
Trains run all year round, if that was your concern.
Define "best".
Trains are running all year through and are more busy during summer months, because most people travel then.
It seems you live in Arizona, which means it's safe to assume you like it hot. Any time from FEB 15 to OCT 15 is the best time to visit those countries. The last possible day for swimming is on SEP 24, our Indian summer. The day after autumn will hit. March is an underappreciated month. The light starts flooding our senses and icicles start melting.
I would be cautious with such date related statements for whole Scandinavia because the area is so huge. While the statements might be valid for Gothenborg the situation in Norway's Tromsø or Denmark's Rømø can be very different.
An example from my side: end of May 2023 we had heavy snow falls with under 0° C in Tromsø while I had around 30° C in Oslo end of May 2018.
MarkK; You are right to mention those regional Scandinavian differences in temperature, and I could have been more explicit, solely referring here to Göteborg, Malmö and therefore also the entirety of Danmark, as these three share the same weather patterns.