I'm wondering why in this game (and the other 18xx games), when a share is sold on the public market, why do the dividends paid for these shares go to the company? It would seem that the public has purchased these shares and the dividends should go to the bank (public).
Indeed. When I revisited the 18xx financial system (after 2038, for 1834 and 1846), I went with this alternative approach. But, these systems have the feature that "unwanted" public shares (those in the stock market) may possibly be bought back by the company.
One way to think of corp. dividends for public shares is that this is implicitly modeling stock repurchases. For the 2038 expansion, I made this explicit.