EDITED (Version 4)
In mathematics, especially in order theory, a maximal element of a subset S of some partially ordered set (poset) is an element of S that is not smaller than [?] any other element in S. https://en.wikipedia.org/wiki/Maximal_and_minimal_elements
Is this a formal definition of a maximal element of a partially ordered set $S$?
$\forall S:[\forall a\in S: a\leq a \\ \land \forall a,b\in S:[a\leq b ~\land~ b\leq a \implies a=b]\\ \land \forall a,b,c\in S:[a\leq b ~\land ~b\leq c \implies a\leq c]$
$\implies \forall m\in S: [Maximal(S,m) \iff\forall a\in S:[m=a \lor \neg [m\le a]]]]$
where $Maximal(S,m)$ means a maximal element of $S$ is $m$.
What you have is instead a formal definition of a maximum or greatest element of $S.$
Instead, you want $$m\in S\wedge\neg(\exists a\in S:m\neq a\wedge m\leq a),$$ or equivalently, $$m\in S\wedge\bigl[\forall a\in S, m=a\vee\neg(m\leq a)\bigr].$$
Consider any set $S$ with more than one element, and the relation $R$ given by $R=\bigl\{\langle a,a\rangle\mid a\in S\bigr\}.$ Then $S$ is partially-ordered by $R,$ and has no greatest element, but all of its elements are maximal.