Theoretical investigation of superconductivity in trilayer square-planar nickelates