We managed to get this working from a gallery which launches a lightbox, via a hack to assets/js/galleries-shortcodes.js.
The solution drew on the documentation for the underlying lightbox tool, Magnificpopup:
https://dimsemenov.com/plugins/magnific-popup/documentation.html
The hack consists of 2 changes:
Line 8 get the the title and add it to the array of slides which is being initialised:
slides.push({
src: $(this).children('a').attr('href'),
src_text: $(this).children('a').text()
});
Line 80 as the lightbox is being enabled, add image attributes which include the title from the slides array:
type: 'image',
image: {
titleSrc: function (item) { return item.data.src_text; }
},
Example
https://www.thamesvalleyldwa.org.uk/midweek-marlow-meander/
Some browsers e.g. Chrome may cache their javascript and have to do a refresh to get this to show up.
If there is a more elegant way to override the plugin function here rather than hack this file, it would be helpful to know.