Ren's sudden arrival in Niawou without any explanation could have more meaning than we think. We could count on our hands the amount of people who knew that Ryo was in possession of the phoenix mirror but the most suspicious characters with this knowledge are probably Chai, Zhu and Ren.
Niao Sun got her information from somewhere that Ryo has the mirror. If we had to guess who told her, Chai is the simplest answer. The answer that makes the most sense. It's nearly confirmed in 3 that he's a watchdog for the chiyoumen and he's a guard in their base. Him not trying to steal the phoenix mirror this time around may have been because he was under orders from Niao Sun not to. Her end game might have been to bait Ryo to the castle, take the phoenix mirror from him and pit him against Lan Di all along.
But here are some reasons why Ren might have been the one to tell Niao Sun about Ryo having the mirror. Firstly, Ren didn't follow Ryo to Bailu village, for reasons unknown. Instead, he magically shows up in Niawou, where both Ryo and Niao Sun are conveniently located at the time. Without any explanation as to how he knew Ryo would be there, I might add. Secondly, the conversations Ryo had with Shenhua about whether Ren is trustworthy or not were a red flag for me. So much so that when I played the game first, I thought that a betrayal was being foreshadowed. Next, is how Mr Muscles, who was Niao Sun's underling, let Ren and Ryo escape after beating them to a bloody pulp. He didn't seem to have any interest in capturing or killing the pair, almost as if he was under orders not to. Maybe Ren's role was to act as Ryo's 'guide' to the castle and ensure that the mirror was safely transferred over.
Speaking of the mirror transfer, Ren backed down pretty quickly when Ryo shut down his attempt to hand over the fake mirror. Ren could easily have known that Ryo would respond like this and that such an action would just prompt Ryo into handing over the real mirror faster, which may have been his goal all along. The fake mirror that Ren bought and baited Lan Di with has also created a possible smokescreen, masking the fact that the real mirror belongs to Niao Sun while Lan Di either has the fake mirror or believes that the real mirror is lost after Ren threw it. This, again, would very conveniently benefit Niao Sun.
Finally, the fact that Ren is still pursuing the treasure after being in a supposedly way worse position to obtain it after Niao Sun gained the Phoenix mirror in the castle, is suspicious. If he wants the treasure, they're going to have defeat both Lan DI AND Niao Sun to get it. Firstly, this is something that Ren is not capable of himself (he didn't stand a chance vs Do Niu or Muscles), so he'll need Ryo's strength to make his wishes come true. The problem is that Ryo doesn't care about the treasure, so once he's beaten Lan Di you'd imagine that he'd have no other motive to beat the rest of the chiyoumen for the sake of the treasure. Maybe for Ren, beating Lan Di is all that he needs Ryo to do to get the treasure because both he and Niao Sun are working together. That's why Ren is still so confident about getting the treasure. The goal is still the same, act as Ryo's guide, monitor his progress as a martial artist and help him on his path to defeating Lan Di, before snatching the dragon mirror and unlocking the treasure.
Niao Sun is supposed to be more known for her cunning than her fighting skills, so perhaps she needs to groom someone to defeat Lan Di, her biggest obstacle for dominance in the Chiyoumen. Maybe Ryo is that man and Ren is acting as a watchdog on her behalf. As I mentioned before, the events with the red snakes boss almost seemed orchestrated, like they were under orders not to kill/imprison him. According to her profile, Niao Sun uses people and crushes them like bugs, so maybe the red snakes were simply obstacles she created for Ryo to gain strength/improve as a martial artist, so that he could take out her sworn enemy. Her plan A might have been to pit them together, have them both die in the castle and take both mirrors. But her plan B might be to rely on Ryo to do her dirty work and for that reason, she needs him alive, hence why Ren fills the role of bodyguard.
Ren, like Niao, can be very cunning and deceptive. Example, tricking Ryo into believing he knew Zhu's precise whereabouts and getting him to hand over 500 dollars before stabbing him in the face. The yellow heads and the heavens are rival gangs, if the chiyoumen had their eyes on the yellow heads, it's not inconceivable that they had their eyes on the heavens as well. In fact, Lan Di taking an interest in the yellow heads boss while Niao Sun takes an interest in the leader of the heavens would create another nice parallel between the pair. It's also interesting that Niao Sun seems to have had knowledge on the Phoenix mirror's whereabouts even before Ryo reaches Niaowu (she began following him and Shenhua from the boat to Niawou at the latest) yet the blue spiders are ransacking the village under what seem to be chiyoumen's orders for the mirror. She seemed to have knowledge of the mirrors that other chiyoumen members seemingly didn't. But how?
Ren probably isn't secretly working for her but there are so many things left unanswered that you have to try to fill in the gaps.