S&P warns of rail merger rating risk