Yes, it's expensive (NOK 260 each for a one-way ticket from Flåm to Myrdal when we were there) but I think this is an experience which is well worth doing whilst you're in Flåm.
We're so glad that we went out of season (mid-September) as it meant that we had no problem whatsoever in finding a seat. In fact, there were only 2 other people in the whole of our cabin, meaning that we could easily go from side to side to see and photograph the best views. The seats were comfortable and the heating made our journey warm and cosy. If your visit coincides with a busier period, then I'd advise you to try and sit on the right hand side of the cabin on the way from Flåm to Myrdal as I think that gives the better view for most of the journey. No food or drinks were served on the train but there is a café at Myrdal.
Unfortunately, some of the best views were obscured by mist and rain during our journey but I can imagine that they are spectacular on a clear day. Certainly, we were treated to some fantastic views in any case, despite the poor weather.
We opted to disembark at Myrdal station and walk back to Flåm. If you do decide to undertake this walk, then take a packed lunch with you as it takes quite some time to walk the 12-13 miles. (It poured with rain for most of the way but there was a handy walking tunnel partway through in which we sheltered for our picnic.) Thankfully, the journey is downhill, which makes it much easier. (I would hate to try it the other way around!) The first part of the walk encompasses reasonably rough terrain and I understand that many people take the train part of the way back and walk the rest of the way. I'm very glad that we decided to tackle the whole stretch, though, as it made for a spectacular outing. The views are incredible (definitely make sure that your camera has spare batteries as you WILL want to take loads of photos!) We saw much more than we had whilst travelling on the train itself.
I must admit that our legs were really tired by the end of the walk (going downhill for such a length of time can be a bit hard) and so you might want to get a bit of distance walking practice in before you attempt it if you're not used to doing so much in one day. Otherwise, not-so-enthusiastic walkers might wish to take the easier option of only walking partway. Some of the stations are easy to reach from the walk so you usually have the choice to take the easy way out if you become too tired. If you can manage to walk the whole distance, though, it is well worth the effort.
This review is the subjective opinion of a TripAdvisor member and not of TripAdvisor LLC.