Mods won’t keep the Java version alive, as discussed here: modded minecraft is dying already.
I don’t think they would kill the Java version if they had to, maybe just put less work into it, or more work into realms instead of the normal game. I think they’re still trying to keep it alive by improving the server side of things with server packs as servers are pretty much the only thing keeping MC alive at the moment.
I think Microsoft bought Minecraft as more of a prototype to show that their frameworks can work on all systems(iOS, Android, & Windows), which is why there are so many versions of it, and that most of those versions can play together.