That Greninja scene is weird. I wonder how it turned back. I pressume that as mentioned he's saying good bye. Although based on the Alain scene, I have a theory about when it takes place.
My guess is the last few minutes are closed out by the announcer like this:
"And so, after another big adventure, unlike anything before, it's time for Ash and Co to say goodbye! After meeting countless friends on the journey through Kalos and stopping a threat unlike any other, everyone must go their separate ways. As Ash makes his way back home, ready for his next adventure, his friends all begin there next step into achieving their dreams! What will happen next?
To be continued.....
Then with that last line, we see Serena meet up with Shauna and prepare to leave, or Clemont fixing Clembot, then the scene of Greninja in the woods, remembering it's journey with Ash, and then we also see the other rivals maybe, and perhaps Allain and Malon, who are overlooking some cliff somewhere. Perhaps journeying around the region or world for Sycamore? Potentially setting up him to appear again one day.