Posterization and blocking in dark areas is a very common problem with x264 -- especially when all the noise is removed. There are a few filters that specialize in adding noise to dark areas to combat that. You can also try using --aq-mode=2 and --aq-strength=1.8 (or somewhere between 1.5 and 2.0) to the x264 parameters. A combination of noise in dark areas and the aq settings should help quite a bit.

Personally I'd avoid h.265 until it's more mature.