The Switch passing the 3DS in Japan is certainly possible, maybe even likely. While the Switch has racked up a huge deficit, that deficit is rapidly shrinking, and that's because the 3DS was clearly more front-loaded. Since they were released at nearly the same time of year (Feb. 26 vs. March 3), we can do a direct aligned comparison with no need for additional caveats:

Assuming it doesn't experience a huge drop next year and can keep eroding its deficit at the same rate, it should end up with a surplus against the 3DS within the next 18-24 months.

Passing the DS, however, is a much, much taller order:

By time the Switch Lite was released, the Switch had managed to rack up a massive deficit against the DS, which was posting absolutely insane sales for nearly two years after its own Lite model was released. While they were released at different times of year (which makes launch-aligned comparisons less accurate), if we exclude the DS's launch holiday sales, the Switch had a deficit of over 8.9M units by the week before the Lite was released. While it has eroded that deficit somewhat, its deficit is still at about 7.3M units. Even if the Switch were to maintain the same level of sales it current does, it will still have a huge deficit remaining at the end of 2021. And again, we're not accounting for the 1.5M units the DS sold in Dec. 2004.

While the Switch will probably pass the 3DS, I don't see any scenario where it passes the DS. The 3DS sold 24.5M units. The DS meanwhile sold 33M units. That's a huge gap, one I don't see the Switch crossing. It may not even make it to the 30M mark. No Nintendo system has ever been that back-loaded in Japan, and I doubt new models or price cuts will make it so back-loaded as to give it a shot at passing the DS.