\documentclass[border=1mm]{standalone}

\usepackage{cmap}
\usepackage[cp1250]{inputenc}	
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{tikz}
\usepackage{float}
\usepackage{siunitx}
\usepackage{amsmath}
\usepackage{upgreek}
\usepackage{pgfplots}
\pgfplotsset{compat=1.17}
\usepgfplotslibrary{units}
% \makeatletter
%\pgfplotsset{
%  unit code/.code 2 args=
%    \begingroup
%    \protected@edef\x{\endgroup\si{#2}}\x
%} 
%\makeatother

\pgfkeys{%
  /tikz/on layer/.code={
    \pgfonlayer{#1}\begingroup
    \aftergroup\endpgfonlayer
    \aftergroup\endgroup
  }
}

\begin{document}
	\begin{tikzpicture}
		\begin{axis}[
			height=7cm,	width=10cm,	grid=major,
    		x unit=\SI{}{\pico\second}, y unit=\SI{}{\micro\ampere},
			xlabel=\texttt{pw},	ylabel={\texttt{a{\_}inj}, $\mathit{RMS}(I_\mathrm{inj})$},
			ymin=0,ymax=600,
			xmin=0, xmax=400,
			ytick distance = 100,
			set layers,
			%x tick label style={/pgf/number format/.cd, set thousands separator={}},
			xticklabel shift = 2 pt,
			legend pos=south west,
			%xtick =\empty
		]					
			
			\addplot +[smooth, solid, thick,color=blue,mark=star] table [x=pw ps, y=a_inj, col sep=semicolon] {pw_analysis.csv};			
			\label{ainj};
			\addplot +[smooth, solid, thick,color=red,mark=star] table [x=pw ps, y=irms, col sep=semicolon] {pw_analysis.csv};
			\label{irms};
		\end{axis}

		\begin{axis}[
			%scale only axis,
			height=7cm,	width=10cm,
			xmin=0, xmax=400,
			ymin=0,ymax=120,
			ytick distance = 20,
			axis y line*=right,
			axis x line=none,
			y unit=\SI{}{\femto\coulomb},
			ylabel={$Q_\mathrm{inj}$},
			legend style={at={(0.3,0.95)},anchor=north}
			]
			\addlegendimage{/pgfplots/refstyle=ainj}\addlegendentry{\texttt{a{\_}inj}};
			\addlegendimage{/pgfplots/refstyle=irms}\addlegendentry{$\mathit{RMS}(I_\mathrm{inj})$};

			\addplot +[smooth, solid, thick,color=black,mark=star] table [x=pw ps, y=q_inj, col sep=semicolon] {pw_analysis.csv};
			\addlegendentry{$Q_\mathrm{inj}$};
		\end{axis}
		
	\end{tikzpicture}
\end{document}