Can't reply on SE due to lack of karma there, but I think the reason this is different on Ubuntu LTS is that what's on 12.04 is not technically 1.0.1g, but 1.0.1 with (all?) changes backported to 1.0.1 by the ubuntu security team for the LTS release. On my 14.04-beta install it says 1.0.1f before, and still 1.0.1f after upgrading in similar fashion.
Basically 1.0.1-4ubuntu-5.12 is the version you want on ubuntu 12.04 (or 1.0.1-1ubuntu2 for 14.04), but openssl version doesn't report that.
Basically 1.0.1-4ubuntu-5.12 is the version you want on ubuntu 12.04 (or 1.0.1-1ubuntu2 for 14.04), but openssl version doesn't report that.