They can be used sometimes with the same meaning as "show", but "mostrare" is closer to "point out" while "dimostrare" closer to "prove" and of course "demonstrate".
"Mostrare" carries the basic meaning, from Latin "Monstrare"="show"
"Dimostrare" comes from Latin De-monstrare =" show from above", so "show by reasoning". It was some sort of phrasal verb, with an additional nuance of meaning, and the Italian word received that.