The accepted answer is not working anymore as the city night line trains are taken out of the timetables.
So now your best bet will be to travel fast by day and/or travel by ferry at night.
Seat 61 suggests that you might use the Harwich to Hook of Holland ferry overnight, taking a day train to Hamburg, take a train the next day via Copenhagen to Stockholm and take an overnight train from there.
The German rail site offers several options for your travel Hook to Hamburg, the ferries arrival is scheduled for 8:00 AM, which would get you into Hamburg (with 3 or 4 changes) by 16:15 or 17:15, say it get you to your hotel by 5 or 6 PM, (17:00 to 18:00) giving you a good evening to explore and a good night of sleep.
If you are lucky (and have 'every train' tickets which are more expensive) you might even make it to Hamburg just after 3 PM/15:10.
Hamburg to Sweden you can find on the same German site.
In Sweden you better use the Swedish site for the best results but the German site will still work and might be your choice.
There are several options.
You can travel Hamburg to Stockholm on the day train, and go on to Östersund overnight.
Or arrive in the afternoon and take a day train north the next day, again giving you a part of the afternoon and the evening to explore the city.
Some times of the year there are still overnight trains from Hamburg to Copenhagen, with good connections to Stockholm, but those trains are likely restricted to summer holiday season only as far as I can tell now.
The day train from Stockholm to Östersund takes about 5 hours, the overnight train, (leaving at 21:12 on the day I checked) takes about 9 hours.
Of course, timetables change, not just by year but also by day of the week and throughout the year.
Do check your intended travel before setting off. Most train sites include travel more than 3 months ahead, only when searching before the time table switches (early December and early summer) for trains after the switch you may not get results.
And as reminded by @Anonymous, there are a few ferries from Germany to Sweden, most of which can be reached by public transport on both ends, if maybe less convenient than rail travel through Denmark.
Do check while you do your planning but at this time I see ferries from Kiel to Gothenburg, Travemunde to Malmo, Rostock to Trelleborg and Sassnitz to Trelleborg, and I might miss one. I found them on this ferry search site.