I'm not so sure the hobby is in trouble. There have been more products released in the past few years than in decades past. The products run the gamut from high end RTR brass to low end RTR plastic, from $50 caboose and rolling stock kits to $9 shake-the-box kits. From DCC, Sound, Computer driven programming and operations to the old reliable rheostat controller and hand-thrown turnouts, from code 100 snap track to Central Valley turnout kits and Micro Engineering flextrack to handlaying templates to prefabricated handlaid track to Proto87 finescale, it's all still available and more available than ever before.
And the quality of the products... far better than we ever had it before. Today we can argue over which SD40-2 model has a higher level of prototype fidelity than the other. 20 years ago, you were happy to have the Athearn SD40-2 or the GSB SD40-2! Couplers are better, wheels are better, electronics are better and smoother and more reliable. Rolling stock is designed to connect to other cars to form more train than comes in the set.
Most of the old brick and mortar hobby shops are disappearing around here, and I suspect elsewhere, too, but the ones that are still around are selling at prices you could only get through mail order just ten years ago. And they are also taking advantage of new markets like ebay, which is the equivalent of a well-lit display case in a 24 hour, 7 day a week store that's located on every street corner in the world. And that brings me to the most important piece of evidence that the hobby is not in decline: the internet.
When I had trouble with broken couplers or a locomotive that was wired backwards (I reassembled an Athearn F7 the wrong way once as a kid and didn't know what the problem was), the only person I could turn to was my Grandpa. I got through the growing pains and became an experienced modeler. Not everyone can get through that stage without giving up, especially if they don't have a ready source of knowledgable help. So, in the 80s if you tried HO railroading with a Tyco or Bachmann set and there was a problem, you either bought more stuff or repaired what you had or stored it away not to try it again.
Today, when a beginner has a problem in model railroading, they do what anyone else who has a problem does: they Google it. And Googling it brings them here, to the trains.com or Atlas forums and they get their questions answered. They also get encouragement, they get inspiration, they get knowledge, they get experience, and all of it comes free of charge. They can learn at whatever pace they choose.
Sure, the internet has its faults: there are curmudgeons, show-offs

o pot, kettle, black...), know-it-alls, gurus, newbies, foamers, and even the occasional troll, but even with all that, I'm not sure my level of participation would be near as high without the internet. I am positive it would not be as fulfilling, and I am positive I wouldn't have met some really good friends.
But, these games and their subcultures are exactly the same thing, so it's impossible to say one is better than the other as far as the internet/social world is concerned. I do know this about XBOX and computer games: I can only kill so many aliens or race so many European sports cars before I'm bored and mentally exhausted. On the other hand, model railroading, with its many facets, is something I can dive into or retreat to. One facet can provide relaxation from another facet or simply relaxation from the "real" world.
In summary, I don't know how long the hobby will be a viable business enterprise for companies like Atlas or Lionel or Red Caboose or Branchline, but with the quality products I've purchased over the years, it will be with me for the rest of my life.