Due to the 3ds’s proprietary nature (meaning that parts of the motherboard cannot be bought by just anyone) and the fact that the 3ds’s proprietary parts may now be discontinued due to the console’s age, this would prove extremely difficult. It may be possible to take a preexisting motherboard and upgrade the ram, but again due to the proprietary parts, an upgraded ram module would be hard and expensive to produce, not to mention all of the software that would need to be adapted for the upgrade, and individual games would have to be patched to support it. Currently your best bet would be to simply emulate the console, which, if you have good specs, would play the games better than on real hardware. Overall, this currently isn’t possible in the 3ds form factor.