No, there is not, even if you do not require $f$ to be injective. To see this, let $F$ be any ultrafilter on $\kappa$, and consider the following space $X_F$. The underlying set of $X_F$ is $\kappa\cup \{x_0,x_1\}$, with topology generated by the sets $\{\alpha\}$ for $\alpha\in\kappa$, $\{x_0\}\cup\kappa$, and $\{x_1\}\cup A$ for any $A\in F$. Note that $X_F$ is connected, as it is easy to see that any clopen set containing $x_0$ must be all of $X_F$.

Now suppose the topology $\tau_{\kappa+1}$ you ask for exists; let $f:\kappa+1\to X_F$ be such that $f(0)=x_0$ and $f(\kappa)=x_1$. Let $F'$ be any ultrafilter other than $F$; I claim that $f$ is not continuous as a map $\kappa+1\to X_{F'}$. Indeed, if it were, let $A\in F$ be such that $\kappa\setminus A\in F'$. Then $$f^{-1}(\{x_1\})=f^{-1}(\{x_1\}\cup A)\cap f^{-1}(\{x_1\}\cup\kappa\setminus A)$$ would be open in $\kappa+1$. But $\{x_1\}$ is closed in $X_F$, so $f^{-1}(\{x_1\})$ is closed and hence clopen in $\kappa+1$. But there clearly can be no clopen set that separates $0$ and $\kappa$ in $\kappa+1$, so this is a contradiction.

Thus each function $f:\kappa+1\to\kappa\cup\{x_0,x_1\}$ can be continuous as a map to $X_F$ for at most one ultrafilter $F$. There are $2^{2^\kappa}$ ultrafilters on $\kappa$ and only $2^\kappa$ such functions $f$, so this is impossible.