Depends on how you define your metric of success. According to VGC WiiU sold more units — barely, but more. If that is final, then this can be an answer.
If we look more into detail, the Vita was home to a lot of very unique japanese titles. As Sony didn't follow up with another handheld these games and often also their successors eventually made their way to the Switch.
WiiU while it had abysmal hardware sales, had some very great games that showed on Switch their sales potential. Splatoon, Mario Maker and especially Mario Kart 8 were massively successful games, which by far outshined their original release platform.
In the end both their market shares got assimilated by the Switch. Their gaming legacy lives on there.







