Such a marriage is only valid with the permissible of a wali AND if this marriage theoretically is in the interest of the girl and does not cause her any harm. Otherwise it would not be valid. If a girl has no wali (such has her father/grandfather has passed away), the jurist (qualified Mujtahid) would be her wali.