No. With a >legit< Kazakhstan passport they could even enter visa exempt for 60 days.
Visa for Afghans very difficult. Has to go through Thai foreign department and can take up to two months (according to website).
Even when going through transit their passports will be checked, don't you think so?