Sorry, one factory that works at a pürofit or 20 factories of which some do profit, some currently not. Which is more valuable?
The number of factories is really irrelevant.
Suppose the one factory is making billions. 10 of the 20 factories are making 10 million a year. The other 10 are losing 5 million a year. The one factory is more valuable.
Sure, the one factory is more valuable as the other ones - each separately. But the value lies not only in profit it makes currently. Because that can change fast. Say, one is making expensive smartphones, the other is making simpler phones in bigger number. The smartphone factory makes more profit. But then a worldwide financial crisis hits, and people have less money to spend. Instantly the factory making the simpler phones becomes more profitable.
Value lies in simple assets. The machines, the workforce, the distribution lines. A factory can be reassigned to assemble another more profitable product with the same machines. While profit certainly is important to check the value, it is by far not the only thing.
And now look, how much assets Sony has worldwide, and how much Nintendo. It is not only factories, it includes also buildings, company cars, even furniture. Then you also have to see the intellectual properties. Look alone at how much more patents Sony has alone in 2017 compared with Nintendo:
And that's not all. Copyrights own Sony also a lot more. Remember Sony is not only a gaming company, but also does movies.
All these values accounts to something. That makes a company more valuable. Even if Nintendo makes more profit for a year or two - profit is very volatile, it depends on success of a few products in most cases. Look how the future of Apple turned with just one product, the iphone.
Wikipedia has listed Sony with following data:
Revenue: ¥7.6 trillion / Net income: ¥73.3 billion / Total assets: ¥17.66 trillion
Revenue: ¥489.095 billion / Profit: ¥102.574 billion / Total assets: ¥1.469 trillion
For both companies it's from their financial statements for the financial year ending in march 2017.
As you can see, although Nintendo profited more over this year, the value of the assets alone should secure that Sony has a higher value.
Sure, you price in assumptions about the future, but thinking that Nintendo increases their assets tenfold is just bollocks.
And remember, profit is volatile. The base of all profit is revenue, and that is much more higher in Sonys case. That can turn fast into a higher profit.