TL-DR: Remove one of the contributions (and all earnings therefrom) for 2017 by December 31, 2017. Don't wait till after the New Year to tell the IRA custodian to count it as a 2018 contribution.
You have double-contributed to IRAs for 2017, and so, by December 31, 2017, you should withdraw one of the contributions as well as the gains (if any) that the contribution has earned. You cannot leave all the money in the IRAs and simply tell the IRA custodian (before April 15, 2018) to count one of the two contributions as being for 2018 because that contribution would then have been made during 2017 for 2018.
It would be different if you were planning on a $5500 contribution for 2017 between January 1, 2018 and April 15, 2018, and after making it, realized that you had already made a $5500 contribution for 2017 during 2017, and told the IRA custodian to count the one made for 2017 in 2018 as being a contribution for 2018 instead of for 2017. That is perfectly OK because the gains made during 2018 on that contribution (from the time of the contribution in 2018 till the time you tell the IRA custodian that you really meant to check the 2018 box on the contribution you sent in last week/month) would be gains on the 2018 IRA contribution and inside the IRA. But this is not the case here; you have already made a double contribution for 2017, and waiting till after the New Year to tell the IRA custodian that one of $5500 contributions made during 2017 was actually to be counted as a 2018 contribution is definitely not OK. You must back out the contribution and all the gains from it first, and then make a fresh 2018 contribution. No money need flow back and forth, but there would be one-way transfer of cash (the gains on the backed-out 2017 contribution) from the IRA custodian to you. Backing out a contribution together with all the gains from it can be done between January 1, 2018 and April 15, 2018 and it effectively is as if the original contribution in 2017 was never made to an IRA account but to a regular taxable account. But the gains made during the time that the money spent in inside the tax-advantaged account becomes regular income to you, and some of it might be 2017 income (mutual fund distributions of dividends and capital gains received during 2017) and the rest capital gains on the sale of the investment in 2018 when you back it out. More headaches to worry about: just back out one contribution during 2017 (you still have two months to do it) and simplify your life.