If you allow $\operatorname{Tr}(ex)$ to be infinite, then the implication is not true. For instance take $x=I$, $\lambda=1/2$ (so $e=I$) and $p$ any infinite projection other than the identity.
When $x$ is positive and compact, and $\lambda>0$, the first implication is true. We have
$$
x=\sum_j x_j e_j,
$$
where $x_1\geq x_2\geq\cdots$ and $\{e_j\}$ are pairwise orthogonal rank-one projections. Let $k$ such that $x_k=\max\{x_j:\ x_j>\lambda\}$. Then $e=\sum_{j\leq k} e_j$ and $xe=\sum_{j\geq k} x_je_j$. Thus
$$
\operatorname{Tr}(xe)=\sum_{j\leq k} x_j.
$$
Using the orthonormal basis associated with the $\{e_j\}$ to calculate the other trace, we have
$$
\operatorname{Tr}(px)=\sum_j x_j\,\operatorname{Tr}(pe_j).
$$
Note that $\sum_j \operatorname{Tr}(pe_j)\leq\operatorname{Tr}(p)=\operatorname{Tr}(e)=k$. Now
\begin{align}
0&=\operatorname{Tr}(xe)-\operatorname{Tr}(px)
=\sum_{j=1}^k (1-\operatorname{Tr}(pe_j))\,x_j +\sum_{j>k} x_j\operatorname{Tr}(pe_j).
\end{align}
Now all the factors in the sums are non-negative, so we have
$$
\operatorname{Tr}(pe_j)=\begin{cases} 1,&\ 1\leq j\leq k\\ 0,&\ j>k\end{cases}.
$$
When $j\leq k$, we get
$$
0=1-1=\operatorname{Tr}(e_j-e_jpe_j).
$$
So, being positive, we get that $e_j-e_jpe_j=0$; that is, $e_j(1-p)e_j=0$. Then $(1-p)e_j=0$ and $pe_j=e_j$. When $j>0$, $0=\operatorname{Tr}(pe_j)=\operatorname{Tr}(e_jpe_j)$, so $e_jp=0$. So $p=p_1+\sum_{j=1}^k e_j $ for some projection $p_1$ orthogonal to $\{e_j\}$; comparing traces, we get that $p=\sum_{j=1}^k e_j=e$.