2PI effective action for the SYK model and tensor field theories