Poland’s ruling Law and Justice (PiS) party was ahead in a national election, but short of a majority, final official results showed on Tuesday.