I don't believe it is necessary to take the train which is outside the terminal.
Last fall we flew in from DEN to ORD on AA connecting to BA out of the international terminal. There is a bus that is operated specifically to take passengers between these terminals (3 and 5 I believe).
This bus may be operated only for AA/BA and IB connections but I am not sure. There were very few signs for it. The bus was on the tarmac, inside security, the whole time. It seemed like a real informal operation but it was functional.