In Ubuntu, one can boot a live USB fully to ram using toram option.
adding toram option
However this procedure is GUI based. Is there anyway to just write down the toram option to the ISO file so that the bootable USB directly boots from RAM?
The GUI based way to boot Ubuntu from RAM is described here.
Edit: All of the mentioned and proposed idea works. Although, I accepted one solution, One can try any of those methods according to their necessity.