Yes, sentence 1 and 2 both convey the same meaning here.
However, using "accidently" carries a slight nuance with it; it makes it sound like the discovery may have been either bad or completely unexpected/unrelated to what you were doing. Because you were reading, the possibility was always there for you to discover the definitions, so you stumbled upon them "by chance," not accidently, even if you weren't actively looking for definitions.
For a casual situation like this, using "by chance" is the most natural way to go.