It is unknown to why he didn't bring back Yahiko. He had pretty big chakra preserves on the account that he had enough to shuffle into 6 different body not counting his own. If he didn't know about the jutsu back then it doesn't really matter because he knew about it when he fought Naruto. The time interval from Yahiko's death to the fight with Naruto shouldn't be a problem because Obito is expected to bring back Madara who died long before Yahiko. He probably wouldn't have died because when he used that jutsu after the fight, he brought back a mass amount of people. If he was supposed to die because of using it, he wouldv'e died after reviving the first person. He died after the fight because he was low on chakra. I believe he didn't bring back Yahiko because he felt as though the world had matured him and he found his own way to create peace that contradicted with Yahiko's beliefs and he had no reason to bring back Yahiko.