L is definitely smarter than Light (officially confirmed). There should be no otherwise. U may say Light at least killed L, but L still knew he'd win after he died. Also as mentioned before, Light had a god on his side and only had had detailed knowledge about the Death note, this wasn't the case with near.
Long story short, L had confirmed Light was Kira but lacked evidence to prove it to the people around him. Even after L's death, everything was more or less in L's plans. As Near says it, Light may have defeated L, but its all the previous investigations that led up to this