Upvote:3
I'm fairly confident that it will be fine.
I searched for RENFE ticket PDFs that I still have on my computer, and none of them seem to have my passport number on them, or even my name. I don't recall ever having my ID checked when boarding an AVE, they just scan your ticket. The passport / ID card number seems to be optional on the RENFE site.
As others have commented, in most countries you will get your old passport back, so you can bring both along to be absolutely certain.