The Gr'a was apparently bothered by this as well. See his glosses on Shulchan Aruch Yoreh Deah siman 352 siff two. I'll try my best to translate and fill in the blanks.
The Mechaber mentions the minhag is to be buried in white. The Gr'a says even though R' Yanai said not to, in the Yerushalmi (Klayim 9:3 and Kesuvos 12:3) we find Rebi Yashia commanding to be buried in white. They asked him 'are you better than your rebi?' (This is a reference to Rabi Yochanan, mentioned right beforehand, who commanded to be buried in a color similar to techeiles and not to be buried in black or white. The Pnei Moshe explains his reasoning as being the same as R' Yanai's) To which Rebi Yashia responded 'am I embarrassed of my actions?' The Pnei Moshe adds that he said this in order to bring his students to yiraas Hashem. (I'm assuming he means that Rabi Yashia was explaining the command of Rabi Yochanan as being a means to bring his students to yiraas Hashem).
The Gr'a also mentions the next amora there, Rabi Yirmiya who also commanded to be buried in white, and the Gr'a ends off by saying and from here the minhag spread.
One point of clarification though, from that gemara it is apparent that Rabi Yirmiya commanded to be buried in white because that is what he always wore in his life. This was his way of strengthening the belief in Techias Hameisim. He wanted to be buried in his regular clothes, with his shoes and walking stick,laying on his side ready to get up when Mishiach comes. But I guess the Gr'a sees the very fact that he was willing to be buried in white also shows he wasn't worried about Rabi Yochanan and Rabi Yanai's concerns.
Also interesting is this idea of strengthening the belief in Moshiach with burial shrouds is brought in the Shach #1 of that siman from Darkei Moshe that whoever makes nice clothing for the dead is confirming his belief in Techias Hameisim. The Shach explains he must be talking about nice linen, however anything too nice would be assur. I assume he means so as not to ignore the enactment of Raban Gamliei to be buried in linen mentioned in Moed Katan 27b and Kesuvos 8b.