A partial answer.
1) for your specific example, the algebra $B$ generated by the rational intervals, the answer is negative. This algebra is countable and dense in $2^\mathbb{R}$. It is countable and zero-dimensional so it has a countably infinite partition into clopen sets, which in turn yields an unbounded continuous real-valued function on $B$. Now look up Problem 3.12.12 in Engelking's *General Topology*, or read [Engelking, R., and Pełczyński, A.. "Remarks on dyadic spaces." Colloquium Mathematicae 11.1 (1963): 55-63][1] to see that if $\beta B$ were equal to $2^\mathbb{R}$ the space $B$ would be pseudocompact.

2) The Boolean algebra $C$ of countable and co-countable subsets of $\mathbb{R}$ is $C^*$-embedded in $2^\mathbb{R}$, and so $2^\mathbb{R}=\beta C$, see [I. Glicksberg, Stone-Čech compactifications of products, Trans. Amer. Math. Soc. 90 (1959), 369--382; MR0105667][2].

So here are two examples, one not injective and one injective. Plus a necessary condition: in order that $\beta B=2^\mathbb{R}$ the subspace $B$ must be *pseudocompact*.


  [1]: https://eudml.org/doc/209832
  [2]: https://doi.org/10.2307/1993177