Outta the box, the Titan X at 1080p / 1440p but not by enough of margin to warrant the price increase. As for RAM, 4 GB is enough for those resolutions. OTOH, the 980 Ti gets up to 31% overclocks, the Titan X, 11% so the 980 Ti will rule when OC'd.
At 4k, frankly no single card is enough for 4k ... I don't see 4k being attractive (60 fps or better, even in SLI until late 2016 at the earliest. And I wouldn't buy a 4k monitor now anyway until Display Port 1.3 and 120 Hz arrives