Depends how you sleep...
If you normally sleep on your side, go with UA - I find that when I sleep on my side there is less than 1 cm between my hip and the tray table, so any time I move while sleeping I hit the tray table. This would not be an issue if you sleep on your front or back, in which case the superior passenger comfort of flying the 787 would sway my decision.
(assuming similar price).