A man has been arrested after allegedly breaking into a Mandurah home and bashing an elderly resident in his sleep.