$\def\uv#1{\hat{\mathbf#1}}$
WLOG, consider the normalised vectors of $\vec a$ and $\vec b$, respectively $\uv a$ and $\uv b$.
Let $\uv i$, $\uv j$ and $\uv k$ be the standard unit vectors along the $x$-, $y$- and $z$-axes respectively. Then decompose $\uv a$ into its scalar components:
$$\begin{align*}
\uv a &= a_x \uv i + a_y \uv j + a_z \uv z\\
&= \cos\frac\pi3\cdot \uv i + \cos \frac\pi4\cdot \uv j + a_z \uv k\\
&= \frac12 \uv i + \frac1{\sqrt 2} \uv j + a_z \uv k
\end{align*}$$
Like what OP already did in the question, $\uv a$ has length $1$:
$$\begin{align*}
\left(\frac12\right)^2 + \left(\frac1{\sqrt2}\right)^2 + a_z^2 &= 1\\
a_z^2 &= 1-\frac14 - \frac12\\
&= \frac14\\
a_z &= \frac12
\end{align*}$$
Assuming the "sharp" angle that $\vec a$ makes with the $z$-axis means an "acute" angle, $a_z$ is taken to be positive.
Similarly, decompose $\uv b$ into its scalar components:
$$\begin{align*}
\uv b &= \cos\frac\pi6 \cdot \uv i + b_y \uv j + b_z \uv k\\
&= \frac{\sqrt3}2 \uv i + b_y \uv j + b_z \uv k
\end{align*}$$
$\vec a$ and $\vec b$ are perpendicular, so $\uv a \cdot \uv b = 0$:
$$\begin{align*}
\frac12 \cdot \frac{\sqrt3}2 + \frac1{\sqrt2} b_y + \frac12 b_z&= 0\\
b_z &= -\frac{\sqrt3}2 - \sqrt2 b_y
\end{align*}$$
$\uv b$ has length $1$:
$$\begin{align*}
\left(\frac{\sqrt3}2\right)^2 + b_y ^2 + b_z^2 &= 1\\
\left(\frac{\sqrt3}2\right)^2 + b_y ^2 + \left(-\frac{\sqrt3}2 - \sqrt2 b_y\right)^2 &= 1\\
\frac{3}4 + b_y ^2 + \frac{3}4 + \sqrt 6 b_y +2 b_y^2 &= 1\\
3b_y^2 + \sqrt6 b_y +\frac12 &= 0\\
b_y &= \frac{-\sqrt6 \pm\sqrt{6-4\cdot 3/2}}{2\cdot 3}\\
&= -\frac{1}{\sqrt 6}\\
b_z &= -\frac{\sqrt3}{2} + \sqrt2 \cdot \frac{1}{\sqrt6}\\
&= -\frac{1}{2\sqrt3}\\
\uv b &= \frac{\sqrt3}2 \uv i - \frac1{\sqrt6} \uv j - \frac{1}{2\sqrt3}\uv k
\end{align*}$$
So $\vec b$ makes the angle $\arccos b_y = \arccos\left(- \frac1{\sqrt6}\right)$ with the $y$-axis, and makes the angle $\arccos b_z = \arccos\left(\frac{1}{2\sqrt3}\right)$ with the $z$-axis.