This is a problem that many triathletes suffer from, and there could be any number of causes to your lower back issue, but here are some of the most common:
Bike position: a saddle which is too high or a handlebar set-up which is too low could definitely lead to a sore back. Make sure you’re at one with your bike and your measurements, as cutting corners could lead to the problems you’re currently facing.
Poor gear selection: pushing a gear that’s too big for too long, for example on climbs where you need to be spinning out lightly, could also be exacerbating the problem. Do some trial and error and find out what your optimum pedal cadence is, then on climbs try to make your cadence as close to what it would be on the flats as possible, while keeping a steady heart rate (or power output if you have a power meter at your disposal to measure this).
Weak core muscles: the heavy load of big gear riding combined with a weak core can cause those muscles to fatigue. Your lower back muscles will then overwork, leading to a tight back. Strengthen that core and don’t let this be your undoing, as it’s fundamental and relatively time efficient to work on!
Tight hamstrings and hip flexors: this is something that most triathletes are prone to. Both of these will affect the position of the pelvis, which can in turn lead to a tight lower back. It’s possible that you may be suffering from this problem before you even start to ride. A long ride will just exacerbate this even more as you start to fatigue and overused muscles begin to lock up.
I would suggest that your first action should be to visit a sports physio, ideally someone with additional knowledge of cycling/cycle-specific injuries. You may even be lucky enough to find one who can perform a bike fit for you! Fixing these two issues should go a long way towards helping your lower back problem, and your physio visit might also reveal if indeed your core is weak, or if your hamstrings are too tight. Some regular simple exercises and stretches will improve both of these greatly.