Go to the end, hide underneath a structure to prevent endermen killing you, look at as many endermen as possible, start hitting them with a sword from underneath that protective structure, after you kill all hostile endermen, all remaining endermen in surrounding area will be passive. You can come up to them, strike them, look at them, and they won't do anything aggressive.
I actually have had this happen to me as well. This was on a server version of MC 1.12 Prerelease 2. I was able to record what happened. They followed me around, but did not attack me even though they were agroed on me.
https://www.youtube.com/watch?v=qCAj1xXvGBE