Steam Deck has 16 GB of LPDDR5 6400 MT/s RAM VS. the Switch 2's alleged 12 GB of LPDDR5(X?) 7500 MT/s RAM. Breaking that down into bandwidth numbers, that's 88 GB/s for the Steam Deck and 120 GB/s for the Switch 2. On paper the Switch 2 has it beat in bandwidth, but not quantity. That being said...
As a general note, it's hard to compare them. Like, really hard. Their architectures don't handle memory bandwidth the same, and the environments are different too. One is a portable PC that plays games and another a game console with a closed ecosystem. I also don't know off the top of my head how much memory the Steam Deck allocates to the OS, nor do we know how much the Switch 2's OS will use. The Deck's extra RAM could matter or it could not if a bunch of its memory is going to the OS, the Switch 2's closed environment and higher level of accessibility/programming provided by NVN means that you can better optimize ports, or even optimize them in the first place compared to the Deck! Fun stuff like that.
Putting it in car terms, It's not so much comparing a sports car to a truck, but rather like comparing a Miata to a Honda S2K. Yeah they're both sporty vehicles, both convertibles, and at a surface level do the same thing of providing a fun experience (yay fast* cars, yay gaming), but everything from how it makes power/how the engine revs out, to the suspension of the cars, and to the design ethos is different.
*lol nah