My dilemma is how to fit a visit to Yokohama and Kamakura/Enoshima around the Rugby World Cup events which we are not interested in at all but I expect a lot of crowding in the train stations and the sites there.I think you need to put your expectation of crowds into perspective.
The Tokyo stadium holds 50,000 spectators and is located in Chofu:
https://www.rugbyworldcup.com/venues/tokyo-stadium Chofu is nowhere close to Yokohama or your possible route from Tokyo to Yokohama, really kind of regardless where you decide to stay in Tokyo. Most people will probably go through Shinjuku to Chofu. Let's assume that 40,000 of the spectators will all go through Shinjuku, however Shinjuku station on average has 3.6 million people travelling through it every day. Add 40,000 to that, not a huge increase.
https://en.wikipedia.org/wiki/Shinjuku_StationThe Yokohama station is bigger at 72,000 spectators:
https://www.rugbyworldcup.com/venues/international-stadium-yokohamaAnd it is admittedly located closer to the way you would take from Tokyo to Yokohama (or Kamakura).
I went to that stadium a few years back for a FIFA Club World Cup game, which had 64,000 spectators:
https://www.fifa.com/clubworldcup/matches/round=275782/match=300338752...Yes, from the station to the stadium streets were packed with people and yes, going back the streets to the station were packed again and it took a while to get into the station. But I don't remember that the trains were specially crowded. Yes, probably a bit more crowded than normal at the same time of the day / weekday, but nothing that amounts to normally packed trains in morning rush hour in Tokyo.
If you want to avoid being packed into a train, the much more important factor is to avoid morning rush hour in Tokyo. I haven't looked it up, but there must be a statistic somewhere out there explaining which lines are most crowded at which time of the day, but as long as you stay in Tokyo and go to Yokohama / Kamakura / Enoshima, even if you travel right in the morning rush hour, you are going to go against the flow at least most of the time (at least from somewhere around Shinagawa onwards). (And no, I am not saying you should stay in Shinagawa which is a rather dull neighbourhood. )
If you don't mind changing hotel, by all means get a hotel for a few days in Yokohama (or depending on your interests Kamakura or Enoshima), but changing hotels is only going to add complication to your trip.
I obviously haven't been to Japan during the 2019 Rugby World Cup (as no one else has), but I just can't see how an event of about 70,000 spectators at most can alter the whole of Tokyo / Yokohama so much when we are speaking about a region with 38 million inhabitants:
https://en.wikipedia.org/wiki/Greater_Tokyo_AreaYes, inhabitants aren't tourists, and yes, I would expect more tourists on really any day during that period than in 2018, probably. But still Japan did get a little bit over 30 million tourists last year:
https://en.wikipedia.org/wiki/Tourism_in_Japan So with the RWC, what is it going to be? 1 million more? Not really a significant increase, when tourist numbers are probably going to increase anyway. The government works on a plan to have 40 million tourists by 2020 (which probably already includes all the Olympics tourists). Compare that to France who gets over 85 million tourists a year:
https://en.wikipedia.org/wiki/World_Tourism_rankingsLooking at tourists per capita, Japan probably doesn't even rank among the first 80 countries:
https://www.telegraph.co.uk/travel/maps-and-graphics/countries-where-t...So bottom line, do your visit as you plan, and enjoy your trip!