At 2am, this is almost certainly the roof itself (or the gutters) cooling down overnight and contracting. Ticking during the day would be the roof expanding in the heat.
A 13C temperature range is quite enough to do this.
There probably isn't a fix. If it is a gutter you might be able to lubricate where it passes through the brackets.