There's one brand (named after Louis Pasteur) that treats their milk at 63 degrees for half an hour. It's more expensive and not widely available, but it tastes so much better.
The funny thing is that most of the UHT milk here is still only rated for a shelf life of 10 days. You have to pay extra for some sort of super-UHT variant that comes in smaller, thicker cartons if you want to keep it for a few months. Perhaps the rules were set when refrigerated distribution wasn't as widespread as it is now. Or maybe the major brands just prefer to use cheap, non-sterile containers. Either way, we're stuck with disgusting UHT milk that doesn't even last long, negating its only raison d'etre.
Check out ロングライフ牛乳 on amazon or rakuten.
On the other hand I think I might have become lactose intolerant recently. Trying to stop drinking milk to see if it helps certain issues
You can get milk which is just pasteurised. It's called 低温殺菌牛乳 (teion sakkin gyunyu) but you have to pay a premium.
Personally I find the regular milk in Japan unpleasant enough that I basically stopped drinking milk after moving here.