As I understand it you cannot use IUP to buy a phone on a carrier with whom you do not have an account. So your plan would likely fail as the Apple employee will need your T-Mobile credentials to process/complete the purchase.
If you buy the phone for full price you should be fine though.