I would say that they did not use apex for the flag, since it isn’t being interacted with, which is the main point of using apex cloth. Instead, they probably just animated it in the material, which probably is also a bit better for performance compared to apex.
This is a very basic setup of what first came into my mind:
I just used a basic texture for the base color and a simple grass wind for the actual “waving” of the material. You could definitely tweak it a bit. It works but I think there are better ways that are of much higher quality than this. This setup might just do the job if the flag is in the distance and not the center of attention.
You could take a look at the vehicle example game from Epic. At the starting/finish line, there are two flags that are waving in the wind. I haven’t opened that demo in ages and I’m not going to bother creating a 4.11 version of the project but I’m pretty sure that they animated it in the material so the materials for those two flags should be able to help you out if you wanted to recreate it. It is probably much better than my material and I would definitely recommend checking it out.