Maybe I'm misunderstanding the problem - but my UltraFine 23.7" displays both adapt automatically to room brightness with sensors built into each monitor. Using macOS 10.14.6 on a 2017 15" MBP with Touch Bar (
MacBookPro14,3)
Interesting. What's the model number on your UltraFine? And can you go to System Preferences > Displays and confirm that there are is a checkbox for "Automatically adjust brightness" on the control windows for both monitors? To my knowledge, no one with the 4k or 5k UltraFine has this option, even on the latest firmware.