The party led by Jarosław Kaczyński has achieved its best result in many months.