To sum it up, if you don't care about the lack of many features on the iPhone, if you don't care about the washed out images the OLED panel produces (I like more color punchy displays, which is what Samsung does with their AMOLED panels), if you don't care about slow charging (no fast charging out of the box), if you don't care that you don't get a dongle,if you don't care about the display cutout, etc etc... then go for the Xs Max.
iOS is more secure than Android, and that's been proven, but Android isn't far behind.
In the iOS Ecosystem you're basically a "jailed person" that has the freedom to do anything, but only you and you,whilst in Android you feel more open.
Processor wise, it's one of the world's currently most powerful smartphone, but it does not have any copper cooling,whilst the Note 9 does. This means that you will likely experience throttling issues if you're going to play for extensive period of times.
With the new 7nm process, and slightly bigger 3174mAh battery, you're gonna get a pretty good battery life + the optimisation apple has provided. And with 4GB of ram and decent optimisation this phone puts every other phone offside.
The Note 9 on the other hand, is a far different phone, and for me it's what I would choose if I were in this situation.
Note 9 has a massive 4,000mAh battery which isn't that bad in getting you most out of the day. Yes it probably lacks optimisation, but that's to be improved in One UI, with the Android 9 update. It's not that far behind the XS Max.
Note 9 has far more features, IP 68 Water and Dust Resistance, and on top of that it has pretty decent stereo sound with Dolby Atmos. It also has a headphone jack, which imo its still better than going wireless, because wired won't drain battery and you won't need to charge both your phone and headset. Bluetooth can sometimes give out delay, which I don't prefer but it's almost 2019 and Bluetooth has sure improved. That shouldn't be a big problem since it would probably occur when playing games, or never at all. Another good thing is the Expandable memory, Type - C, a far better camera than the iPhone imo.
Low light photos are great thanks to the dual aperture system, something that the iPhone does not have. Oh and neither a fingerprint sensor, which is what Note 9 packs.
Facial unlock is miles better than the XS Max, but the one on the Note 9 isn't bad either. It's just that it's a bit slow.
Oh, and I forgot the S pen. If you like drawing, presenting, pretty much doing stuff with the S pen, then Note 9 should be your go.
It comes with a fast charger out of the box. It also includes not so bad earbuds, it does not have any kind of display cutout, and overall a solid device. Cheaper than the XS Max, and oh it comes with Android which security wise its not that far behind iOS.
I can tell you that, because I'm using a cheaper Galaxy variant, on top of Android 8.1 with Samsung Experience 9.5 and I haven't had any security issues, nor any kind of virus or malware. Note 9 should eventually be far better and safer.
Snapdragon 845 is pretty fast, and Note 9 has some great cooling so you never run into issues, unlike Apple's A12 bionic chip.
It might not be as powerful as A12, but it's great (currently one of the best processor an Android device can have), and it gets the job done with ease. 6 or 8 GB if ram is more than enough to do heavy ram management and intense gaming. There are also more stuff to say about the Note 9, which would take me a lot of time to write.
I would just recommend you get the Note 9,but it's still up to you to choose.
Both have their pros and cons, and the XS Max has more cons than pros.
Again,i reccomend you Note 9,but it's still up to you to choose.