For a few months, at two inches, no, it should be fine in there. Long term though you'd want to find it another home.
Heck, a lot of people quarantine tangs in 20g tanks and they are larger than 2 inches, so there shouldnt be any problem at all really. Just make sure you have a upgrade plan.
Ideally, you wait until you have the larger tank before you buy the fish, or dont buy fish that are too small for your tank long term.