Can you construct a railway to Toulon through Marseille? (Paris Connection)
According to this response on BoardGameGeeks, immediately means after you are done completing the action that causes the game to end. This is a poor wording then in the game rules, and it should say instead of 'immediately' "at the end of the current turn", or something similar.