Only if everyone is expected to be wearing space suits.
I wasn't thinking the engineering of the tube, more the vehicles operating within. Assuming that there's a desire to have plain-clothed passengers.
On mars or the moon you might have separated habitats connected by rail, the cars themselves could utilize the mature tech from that old hyperloop thing we've been relying on for decades and millions of passengers use every day, etc..