Both of the monitors use TN panels, so ULMB should perform well if you intend to use that feature. (I prefer G-Sync instead of ULMB myself most of the time.)
The 144Hz vs 165Hz thing is a non-issue. The 21Hz difference is so minor that it doesn't make a big difference. You'd need at least 180Hz in order to clearly see a difference vs 144.
As for which one to pick, I'd go for the larger one, simply because both of them are 1440p. 23.8" is IMO too small, unless you explicitly want a "retina" style display, meaning you get reduced screen space (because you have to use 150% or 200% scaling in Windows.) With a 27" display on the other hand, you can either keep using 100% scaling, or just 125% (depending on how far you like the monitor to be, or how good your eyesight is.)
A larger display and more desktop space has advantages; games just feel more "wow", and same when watching movies. And you can fit more applications on your desktop. A smaller display with higher DPI has the advantage of extremely sharp text rendering, and less visible aliasing in games.
One thing to note here: if you're upgrading from a 24" 1080, then 27" 1440p is both larger
and has higher DPI. So it's going to be an upgrade in both of these things (more desktop space, larger screen,
and sharper image with less aliasing.)
However, it should be noted that since these are TN monitors, 27" is going to pronounce the image quality problems of TN panels more strongly. As you probably know, TN has rather severe viewing angle issues, and on a 27" TN that is close to your head, this will result in more color and gamma shift at the bottom of the screen and at the edges.
If you want a bump in image quality, you might want to look into the IPS monitors. VA monitors might also be worth investigating. IPS and VA displays are quite a bit more expensive though, mind you. And if you've been out of the loop for a while, IPS and VA displays have now been developed that are performing excellently for gaming. Traditionally IPS/VA had pixel response issues making them not very suitable for playing games on them, but this is no longer the case.
Personally, when I went from TN to a 27" IPS, I was very pleased. I posted my impressions of it
in this post.