unit price remains stable, unit sales have increased 10%, unit revenue has increased 25%, then profit has absolutely increased (and as you say, only due to a decrease in costs).
That alone doesn’t tell us anything about whether profit went up or down.
It ticked up a bit recently because of the MacBook Pro with TouchBar; the iMac Pro[1] ships next month at a starting price of $4999; we know there will be a revised Mac Pro[2] in 2018 that will be similarly priced for starters but probably go significantly higher depending on the configuration.
[1] https://www.apple.com/imac-pro/specs/
[2] https://www.macworld.co.uk/news/mac/new-mac-pro-2018-latest-...
So the average selling price and units will continue to increase due to the pent-up demand for pro-level Macs.
Except for the iPhone, the Mac generates more revenue than any other single product Apple sells.
[ADDED: And as others have noted, no iPhone X sales happened anyway before the end of the quarter being reported and only about a week of iPhone 8 sales.]