For reliability I would say it's very hard to know I would say though that Lenovo does have an excellent track record for durability and repairability and for basic stuff like that the pentium could do well
The pentium g5400 only has 2 cores and 4 threads as for the i5 8400 has 6 cores and 6 threads I would say that the one with the i5 8400 would be the way better deal for more tasks that use multicore preformance and that you should stay away from the ...