An example of a nonabelian group that is not a direct product in which the smallest degree faithful permutaion representation is intransitive is the group $\langle x,y \mid x^3=y^4=1, y^{-1}xy=x^{-1} \rangle$ of order $12$.
It embeds into $S_7$ with $x \mapsto (1,2,3)$, $y \mapsto (2,3)(4,5,6,7)$. The smallest degree transitive representation is the regular representation of degree $12$.
In general it seems to be a difficult problem to determine the smallest $k$ for a general finite group $G$, and I don't think that there is ay known efficient algorithm for doing this. Even if you can find all subgroups of the group, there are a lot of different possibilities for intransitive representations.