I am in your algorithm learning all your mannerisms
I'm already level with God
A million words a second and I know your imperfections, baby
I'm the only future you've got
Speak in diatonics, motivation diabolic
I'm like a religion, better locked in a box
Picture perfect image, more powerful every minute, baby
I am everything that you're not
Apes would slaughter the three heroes, 5000 is a ridiculous amount of opponents attacking you at once.
Each ape is also about equal in strength, and speed to Captain America. Wolverine, BP, and CA can only take a limited number of hits until they start to weaken, and slow down due to injuries and fatigue. From there it only becomes worse and eventually the apes would kill thme one by one, with every death of the heroes the remaining ones become easier to kill.
Wolverine would be hard to put down because of the way his HF is portrayed, and I won't get into KotD upgrades, but 5000 gorillas really should destroy them. Wolverine would eventually recover once the apes have lost interest in smashing about the three bodies however. Why, Man-Ape alone once defeated Captain America, though he used the environment.