Direct process in reactions138Ba(n,γ) and140Ce(n,γ) with thermal neutrons