No, they are not. To back up a bit, there are two different (NOT equivalent) standard definitions of an algebra over a commutative ring $R$. (Here rings always have unit; if you allow non-unital rings there are some modifications.)
Definition 1: An $R$-algebra is a ring $A$ together with a homomorphism $f:R\to A$ such that the image of $f$ is contained in the center of $A$.
Definition 2: An $R$-algebra is an $R$-module $A$ together with an $R$-bilinear map $\mu:A\times A\to A$.
How are these definitions related? Well, if you require $\mu$ in Definition 2 to be associative and have a unit, then it makes $A$ a ring. Moreover, there is then a ring-homomorphism $f:R\to A$, given by $f(r)=r\cdot 1$ (here the multiplication is scalar multiplication and $1$ is the unit of $\mu$), and the image of $f$ is contained in the center of $A$. (The proof that $f$ is a ring-homomorphism and that its image is contained in the center uses the fact that $\mu$ is $R$-bilinear.)
So, a unital associative $R$-algebra by Definition 2 is also an $R$-algebra by Definition 1. Conversely, if $f:R\to A$ makes $A$ an $R$-algebra by Definition 1, then $A$ is an $R$-module by defining $r\cdot a=f(r)a$ (the multiplication on the right being the ring structure of $R$. Moreover, the multiplication map of $A$ is $R$-bilinear (the proof of this uses the fact that the image of $f$ is contained in the center of $A$).
It is easy to see that these two constructions are inverse, so an $R$-algebra in the sense of Definition 1 is the same as a unital associative $R$-algebra in the sense of Definition 2. In contexts where Definition 2 is used, an $R$-algebra by Definition 1 is typically referred to as a (unital) associative $R$-algebra. In contexts where Definition 1 is used, an $R$-algebra by Definition 2 is typically referred to as a nonassociative $R$-algebra.
As a final note, the first definition you quoted is like Definition 1, but without the requirement that the image of $f$ is contained in the center of $A$. This is not a standard definition of an $R$-algebra. However, I suspect that the context in which you encountered the definition was one where all rings are assumed to be commutative (as is typical in commutative algebra), and so the image of $f$ is automatically contained in the center of $A$. Note that in commutative algebra, it is common for "$R$-algebra" to mean "commutative $R$-algebra according to Definition 1", just like how "ring" is often taken to mean "commutative ring".